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édente | ||
informatique:rsync [14/03/2021 10:30] – cyrille | informatique:rsync [29/01/2022 14:00] (Version actuelle) – cyrille | ||
---|---|---|---|
Ligne 4: | Ligne 4: | ||
* http:// | * http:// | ||
- | rsync -az remote_user@remote.com:/home/remote_folder/ | + | Voir aussi: |
+ | * https://rclone.org | ||
- | "'' | ||
- | rsync -avz -e ssh remote_user@remote.com:/ | ||
- | |||
- | |||
- | À noter la présence ou l' | ||
Si l'on veut passer des options à la commande ssh on ajoute des guillemets '"': | Si l'on veut passer des options à la commande ssh on ajoute des guillemets '"': | ||
+ | <code bash> | ||
rsync -avz -e "ssh -i ~/ | rsync -avz -e "ssh -i ~/ | ||
+ | </ | ||
+ | |||
+ | À noter la présence ou l' | ||
Quelques options pour la commande rsync: | Quelques options pour la commande rsync: | ||
Ligne 94: | Ligne 94: | ||
gzip $LOG_FILE | gzip $LOG_FILE | ||
+ | </ | ||
+ | |||
+ | ==== Parallelizing rsync ==== | ||
+ | |||
+ | Quand il y a beaucoup de dossiers et fichiers on peut lancer plusieurs '' | ||
+ | |||
+ | Le script de https:// | ||
+ | |||
+ | <code bash> | ||
+ | # | ||
+ | # borrowed / adapted from: https:// | ||
+ | |||
+ | # RSYNC SETUP | ||
+ | RSYNC_PROG=/ | ||
+ | # note the important use of --relative to use relative paths so we don't have to specify the exact path on dest | ||
+ | RSYNC_OPTS=" | ||
+ | export RSYNC_RSH=" | ||
+ | |||
+ | # ENV SETUP | ||
+ | SRCDIR=/ | ||
+ | DESTDIR=/ | ||
+ | # Recommend to match # of CPUs | ||
+ | THREADS=4 | ||
+ | BAD_NODE=server1 | ||
+ | |||
+ | cd $SRCDIR | ||
+ | |||
+ | # COPY | ||
+ | # note the combination of -print0 and -0! | ||
+ | find . -mindepth 1 -maxdepth 1 -print0 | \ | ||
+ | xargs -0 -n1 -P$THREADS -I% \ | ||
+ | $RSYNC_PROG $RSYNC_OPTS " | ||
</ | </ | ||
informatique/rsync.txt · Dernière modification : 29/01/2022 14:00 de cyrille