cowsync is a local filesystem sync tool similar to rsync, but focused on
fast copy-on-write cloning when the platform supports it.
It is intended for local tree-to-tree sync where cheap CoW clones are preferred and a regular byte-for-byte copy is an acceptable fallback.
Current behavior:
- walks a source tree
- filters files with
--includeand--exclude - creates destination directories as needed
- clones files with copy-on-write when available
- falls back to normal file copy when cloning is unsupported
Current non-features:
- no deletion of extra destination files
- no remote sync
- no checksums
- no unchanged-file skipping yet
- macOS: uses
clonefile - Linux: uses
FICLONE - other platforms: falls back to
std::fs::copy
cargo buildFrom crates.io after publish:
cargo install cowsyncFrom a local checkout:
cargo install --path .cowsync <src> <dst> [--include <glob>]... [--exclude <glob>]... [--dry-run] [--verbose]Examples:
cowsync src dst
cowsync src dst --include 'src/**' --exclude '*.log'
cowsync src dst --include node_modules
cowsync src dst --dry-run --verbose- If no
--includerules are provided, all files are included by default. --excluderules take precedence over--include.- Matching is evaluated relative to the source root.
- Bare directory patterns like
node_modulesmatch the whole subtree under that directory.
--dry-runprints planned operations only when combined with--verbose.--verboseprints each file operation asclone <src> -> <dst>.
- Existing destination files at matched paths are overwritten.
- Extra files already present in the destination are left untouched.