3 liens privés
Pour synchroniser un répertoire et son distant sans le git :
rsync -avirzh --exclude '.git' . <destserver>:~/path/to/dest
rsync -avirzh -e 'ssh -p 2222' . root@IP.IP.IP.IP:~/path/to/dest
With partial, progressive a restart on error :
rsync -Pavirzh -e 'ssh -p 2222' . root@IP.IP.IP.IP:~/path/to/dest
Short explanation :
-P : retry a long transfer that may be interrupted.
-a, --archive : a quick way of saying you want recursion and want to preserve almost everything (also include -r)
-v, --verbose
-i, --itemize-changes : show changes
o A < means that a file is being transferred to the remote host (sent).
o A > means that a file is being transferred to the local host (receive).
o A c means that a local change/creation is occurring for the item
o A h means that the item is a hard link to another item (requires --hard-links).
o A . means that the item is not being updated
o A * means that the rest of the itemized-output area contains a message (e.g. "deleting").
o A s means the size of a regular file is different and will be updated by the file transfer.
o A t means the modification time is different and is being updated to the sender’s value
(requires --times).
o A p means the permissions are different and are being updated to the sender’s value
(requires --perms).
o An o means the owner is different and is being updated to the sender’s value (requires
--owner and super-user privileges).
o A g means the group is different and is being updated to the sender’s value (requires
--group and the authority to set the group).
o The u slot is reserved for future use.
o The a means that the ACL information changed.
o The x means that the extended attribute information changed.
-r, --recursive
-z, --compress
-h, --human-readable
Finalemnt c'est censé marcher out of the box :
exemple des commentaires (c'est le rsync-path qui m'a sauvé moi)
rsync -azh --rsync-path="rsync --no-super" --delete --delete-excluded --exclude-from="/cygdrive/C/Rsync/exclude.txt" -e "ssh -i /cygdrive/C/Users/User/.ssh/id_rsa" --log-file="/cygdrive/C/Rsync/logDoc.txt" "/cygdrive/D/Mes documents" root@192.168.0.5:/volume1/NetBackup/User-PC
Backup d'un serveur sur un autre :
rsync -razh /home/mariadb/backup/ root@secondserver:/home/mariadb/backup-from-firstserver
Pré-requis : partage de clé
C'est d'ailleurs indiqué dans la note :
"Notes:
This scheme is not infallible. Although signing the declaration makes it impossible for a third party to produce arbitrary declarations, it does not prevent them from using force to coerce rsync.net to produce false declarations. The news clip in the signed message serves to demonstrate that that update could not have been created prior to that date. It shows that a series of these updates were not created in advance and posted on this page."