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 [14/03/2021 10:30] – [Synchro de machine] cyrille | informatique:rsync [12/09/2021 09:55] – [Dans un script] Parallelizing rsync cyrille | ||
---|---|---|---|
Ligne 72: | Ligne 72: | ||
#set -x | #set -x | ||
- | RMT=" | + | RMT=" |
SRC=" | SRC=" | ||
DST_PATH=/ | DST_PATH=/ | ||
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