Skip to content

turadg/cowsync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cowsync

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.

Status

Current behavior:

  • walks a source tree
  • filters files with --include and --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

Platforms

  • macOS: uses clonefile
  • Linux: uses FICLONE
  • other platforms: falls back to std::fs::copy

Build

cargo build

Install

From crates.io after publish:

cargo install cowsync

From a local checkout:

cargo install --path .

Usage

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

Filter Semantics

  • If no --include rules are provided, all files are included by default.
  • --exclude rules take precedence over --include.
  • Matching is evaluated relative to the source root.
  • Bare directory patterns like node_modules match the whole subtree under that directory.

Dry Run And Verbose

  • --dry-run prints planned operations only when combined with --verbose.
  • --verbose prints each file operation as clone <src> -> <dst>.

Notes

  • Existing destination files at matched paths are overwritten.
  • Extra files already present in the destination are left untouched.

About

rsync-style reflink/clone copy-on-write tool

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages