Table of Contents

How to parallelize rsync

GNU parallel can run multiple rsync processes concurrently to transfer files in batches.

Usage

This command:

find path/to/src/. -type f -print0 |
    parallel -0 -j 4 -N 100 --eta rsync -aR {} dest/ &&
    rsync -avP path/to/src/ dest/

is approximately equivalent to:

rsync -avP path/to/src/ dest/

Options:

Similarly, this command:

find path/to/./src -type f -print0 |
    parallel -0 -j 4 -N 100 --eta rsync -aR {} dest/ &&
    rsync -avP path/to/src dest/

is approximately equivalent to:

rsync -avP path/to/src dest/

This command:

find path/to/src -type f -print0 |
    parallel -0 -j 4 -N 100 --eta rsync -aR {} dest/ &&
    rsync -avRP path/to/src dest/

is approximately equivalent to:

rsync -avRP path/to/src dest/

Directory Structure

The position of /./ determines which path components are preserved by rsync -R.

For absolute paths, explicitly position /./ to preserve only the intended directory structure. Without /./, rsync -R preserves additional leading path components.

Limitations

The final rsync pass handles symbolic links, empty directories, directory metadata, and any remaining file differences. The && operator ensures that it runs only if GNU parallel succeeds. Add –del to the final rsync command to remove extraneous destination files.

References