informatique:rsync
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédenteProchaine révisionLes deux révisions suivantes | ||
informatique:rsync [19/07/2014 11:06] – cyrille | informatique:rsync [14/03/2021 10:30] – cyrille | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
====== rsync ====== | ====== rsync ====== | ||
+ | * [[https:// | ||
* http:// | * http:// | ||
+ | rsync -az remote_user@remote.com:/ | ||
+ | |||
+ | "'' | ||
rsync -avz -e ssh remote_user@remote.com:/ | rsync -avz -e ssh remote_user@remote.com:/ | ||
+ | |||
À noter la présence ou l' | À noter la présence ou l' | ||
Ligne 40: | Ligne 45: | ||
--daemon run as a rsync daemon | --daemon run as a rsync daemon | ||
--password-file=FILE get password from FILE | --password-file=FILE get password from FILE | ||
+ | </ | ||
+ | |||
+ | ===== Tips & tricks ===== | ||
+ | |||
+ | ==== Synchro de machine ==== | ||
+ | |||
+ | < | ||
+ | rsync -aP / root@5.196.33.193:/ | ||
+ | --exclude=/ | ||
+ | --exclude=/ | ||
+ | --exclude=/ | ||
+ | --exclude=/ | ||
+ | </ | ||
+ | |||
+ | ==== Dans un script ==== | ||
+ | |||
+ | Il peut y avoir des bugs avec l’échappement (escape) des guillemets. | ||
+ | |||
+ | La commande '' | ||
+ | |||
+ | <code bash> | ||
+ | #!/bin/bash | ||
+ | # | ||
+ | |||
+ | # for debug: | ||
+ | #set -x | ||
+ | |||
+ | RMT=" | ||
+ | SRC=" | ||
+ | DST_PATH=/ | ||
+ | |||
+ | # something like : 2011-02-22_07-10 | ||
+ | BACKUP_DATE=`date ' | ||
+ | DST_BACKUP_PATH=$BACKUP_DATE | ||
+ | LOG_FILE=$DST_PATH/ | ||
+ | RSYNC_BIN=/ | ||
+ | |||
+ | $RSYNC_BIN \ | ||
+ | -e " | ||
+ | --quiet \ | ||
+ | --archive \ | ||
+ | --delete --delete-excluded --delete-after \ | ||
+ | --backup --backup-dir=$DST_BACKUP_PATH \ | ||
+ | --itemize-changes --log-file=$LOG_FILE \ | ||
+ | --exclude=' | ||
+ | $SRC $DST_PATH | ||
+ | |||
+ | gzip $LOG_FILE | ||
+ | |||
</ | </ | ||
informatique/rsync.txt · Dernière modification : 29/01/2022 14:00 de cyrille