Search

Lib.rs

› Filesystem › lms
#file-sync #rsync #linux #cli

lms_lib

A fast and reliable alternative to rsync for synchronizing local files

by Wesley Chang, kedap

  • Install
  • API reference
  • GitHub repo (kedap)

1 unstable release

0.4.0 Jan 31, 2022

#36 in #rsync

MIT license

74KB
1.5K SLoC

Lib for LuminS

Luminous Synchronize

A fast and reliable alternative to rsync for synchronizing local files

Build Status Code Coverage Docs

Demo

Features

100% Rust
Powered by the Rayon library for high parallel perfomance
Supported on Unix-based platforms
Extremely fast at synchronizing directories with large quantities of files
Multithreaded copy, remove, and sync
A progress bar using indicatif

Copy

use lms_lib::{core, parse::Flag};
use std::path::Path;

main () {
	let src = Path::new("/foo/bar/hello.txt");
	let dest = Path::new("/bar/foo/hi.txt");
	core::copy(&src, &dest, Flag::empty())?;
}

Sync

use lms_lib::{core, parse::Flag};
use std::path::Path;

main () {
	let src = Path::new("/foo/bar/hello.txt");
	let dest = Path::new("/bar/foo/hi.txt");
	core::synchronize(&src, &dest, Flag::empty())?;
}

Remove

use lms_lib::{core, parse::Flag};
use std::path::Path;

main () {
	let target = Path::new("/bar/foo/hi.txt");
	core::remove(&target, Flag::empty())?;
}

Benchmarks

Using hyperfine on an Intel i7-8550U with the following 2 test folders,

Directory Directory Size Number of Files
1 88MB 7262
2 105MB 252
Command Directory Time
lms sync 1 179.1 ms ± 5.1 ms
rsync -r --delete 1 717.8 ms ± 41.1 ms
lms cp 1 117.3 ms ± 3.6 ms
cp -r 1 283.4 ms ± 13.2 ms
lms rm 1 147.6 ms ± 8.6 ms
rm -rf 1 180.7 ms ± 4.3 ms
---------------------- --------------- -----------------------------
lms sync 2 101.2 ms ± 24.8 ms
rsync -r --delete 2 442.2 ms ± 19.6 ms
lms cp 2 33.8 ms ± 2.8 ms
cp -r 2 143.5 ms ± 18.8 ms
lms rm 2 10.0 ms ± 2.8 ms
rm -rf 2 27.4 ms ± 0.8 ms

Of course, these benchmarks can be highly dependent on CPU and IO devices.

Contributions

Suggestions, issues, and pull requests are welcome!

Dependencies

~7–10MB
~179K SLoC

  • bitflags 1.2
  • blake2 0.9
  • clap 2.33+yaml
  • env_logger 0.7.1
  • hashbrown 0.8+rayon
  • lazy_static
  • log
  • rayon
  • seahash
Related: lms
See also: robosync, ensync, sync_file, bita, pxs, gcs-rsync, sparsync, librsync, sync-ldap-subtrees, cooklang-sync-client, fast_rsync

Lib.rs is an unofficial list of Rust/Cargo crates, created by kornelski. It contains data from multiple sources, including heuristics, and manually curated data. Content of this page is not necessarily endorsed by the authors of the crate. This site is not affiliated with nor endorsed by the Rust Project. If something is missing or incorrect, please file a bug.