Saturday, 24 May 2014

Multiple Rsync[parallel] during data transfer

Sometimes the data transfer is very slow due to network connections.
At that time, we use parallel rsync to transfer the data to other server efficiently.

Script:
-----------
export SRCDIR="/home/."; -->Source Directory
export DESTDIR="root@server.example.com:/home/."; --> Destination Directory
export THREADS="8";
rsync -lptgoDvzd $SRCDIR $DESTDIR; --> transfer the folders & sub-folders first.
cd $SRCDIR;
find . -type f | xargs -n1 -P$THREADS -I% rsync -az % $DESTDIR; -->rsync files in multiple process.

No comments:

Post a Comment