LinuxCommandLibrary

fpsync

Synchronize files between two file systems

TLDR

Recursively synchronize a directory to another location

$ fpsync -v /[path/to/source]/ /[path/to/destination]/
copy

Recursively synchronize a directory with the final pass (It enables rsync's --delete option with each synchronization job)
$ fpsync -v -E /[path/to/source]/ /[path/to/destination]/
copy

Recursively synchronize a directory to a destination using 8 concurrent synchronization jobs
$ fpsync -v -n 8 -E /[path/to/source]/ /[path/to/destination]/
copy

Recursively synchronize a directory to a destination using 8 concurrent synchronization jobs spread over two remote workers (machine1 and machine2)
$ fpsync -v -n 8 -E -w login@machine1 -w login@machine2 -d /[path/to/shared_directory] /[path/to/source]/ /[path/to/destination]/
copy

Recursively synchronize a directory to a destination using 4 local workers, each one transferring at most 1000 files and 100 MB per synchronization job
$ fpsync -v -n 4 -f 1000 -s $((100 * 1024 * 1024)) /[path/to/source]/ /[path/to/destination]/
copy

Recursively synchronize any directories but exclude specific .snapshot* files (Note: Options and values must be separated by a pipe character)
$ fpsync -v -O "-x|.snapshot*" /[path/to/source]/ /[path/to/destination]/
copy

SYNOPSIS

fpsync [options] <srcdir> <dstdir>

PARAMETERS

-v, --verbose
    Increase output verbosity

-q, --quiet
    Suppress non-error messages

--now
    Sync immediately without fpart partitioning (single rsync)

--jobs N
    Set number of parallel rsync jobs (default: CPU cores)

--nice-level LEVEL
    Nice level for rsync processes (0-19)

--ionice-class CLASS
    I/O scheduling class (idle, best-effort, realtime)

--ionice-level LEVEL
    I/O priority level (0-7)

--size-max SIZE
    Max total size per fpart/rsync job (e.g., 1G)

--hash
    Use file hashes for fpart partitioning instead of size/mtime

--rcs-opts 'OPTS'
    Extra options passed to rsync (quote if spaces)

--help
    Show usage summary

--version
    Display version info

DESCRIPTION

fpsync is a high-performance utility for synchronizing large directory trees by combining fpart for intelligent file partitioning with parallel rsync processes. It excels in scenarios involving massive datasets, such as backups or migrations over networks, where traditional rsync bottlenecks due to sequential processing.

Key workflow: fpsync uses fpart to split the source directory into optimal chunks based on file sizes and counts, then launches multiple rsync instances in parallel. This parallelism dramatically boosts throughput, often achieving 5-10x speedups on multi-core systems or high-latency links.

Features include incremental syncs (skipping unchanged files), preservation of permissions/timestamps/symbolic links, bandwidth throttling, and nice/ionice controls for low system impact. It's ideal for servers, NAS syncs, or cloud migrations but requires fpart and rsync installed.

Unlike plain rsync, fpsync minimizes overhead by avoiding full directory traversals per job and supports resume after interruption via fpart's state files.

CAVEATS

Requires fpart and rsync installed; inefficient for small directories (<1GB); high memory use with many small files; test on non-critical data first as parallel rsync can overload I/O.

INSTALLATION

Available in most distros (e.g., apt install fpart); fpsync is bundled with fpart package.

EXAMPLE

fpsync --jobs 4 --nice-level 10 /src /dest
Synchronizes /src to /dest using 4 parallel jobs at low priority.

HISTORY

Developed by René Barta as part of the fpart project around 2015; evolved from community needs for faster rsync alternatives. Actively maintained, with fpsync added to streamline parallel sync workflows in version 1.0+.

SEE ALSO

fpart(1), rsync(1), nice(1), ionice(1)

Copied to clipboard