Outils pour utilisateurs

Outils du site


informatique:rsync

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révisionLes deux révisions suivantes
informatique:rsync [14/03/2021 10:30] cyrilleinformatique:rsync [12/09/2021 09:55] – [Dans un script] Parallelizing rsync cyrille
Ligne 94: Ligne 94:
 gzip $LOG_FILE gzip $LOG_FILE
  
 +</code>
 +
 +==== Parallelizing rsync ====
 +
 +Quand il y a beaucoup de dossiers et fichiers on peut lancer plusieurs ''rsync'' simultanément.
 +
 +Le script de https://mjanja.ch/2014/07/parallelizing-rsync/ où l'on trouvera les explications détaillées.
 +
 +<code bash>
 +#!/usr/bin/env bash
 +# borrowed / adapted from: https://wiki.ncsa.illinois.edu/display/~wglick/Parallel+Rsync
 +
 +# RSYNC SETUP
 +RSYNC_PROG=/usr/bin/rsync
 +# note the important use of --relative to use relative paths so we don't have to specify the exact path on dest
 +RSYNC_OPTS="-aAXv --numeric-ids --progress --human-readable --delete --exclude=.glusterfs --relative"
 +export RSYNC_RSH="ssh -T -c arcfour -o Compression=no -x"
 +
 +# ENV SETUP
 +SRCDIR=/path/to/good/brick
 +DESTDIR=/path/to/bad/brick
 +# 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 "%" $BAD_NODE:$DESTDIR
 </code> </code>
  
informatique/rsync.txt · Dernière modification : 29/01/2022 14:00 de cyrille

Sauf mention contraire, le contenu de ce wiki est placé sous les termes de la licence suivante : CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki