#s3 #sync #file #fs

filesync

Sync files between different sources

3 releases

0.1.2 Nov 15, 2023
0.1.1 Nov 15, 2023
0.1.0 Sep 7, 2023

#587 in Filesystem

21 downloads per month

CC0 license

33KB
735 lines

filesync
build_badge docs_badge crates_badge

Simple Rust library to sync files between different sources.

Currently supports:

  1. Local files
  2. S3 (s3 feature)

Usage

use filesync::{
    local::LocalFiles,
    s3::S3Files,
};

let config = aws_config::load_from_env().await;
let client = aws_sdk_s3::Client::new(&config);

let mut local = LocalFiles::new("./my_local_files", true);
let mut s3 = S3Files::new(client, "my_s3_bucket", "path/in/bucket", true);

let synced_paths = filesync::sync_one_way(&mut local, &mut s3).await?;
assert_eq!(synced_paths, vec![PathBuf::from("my_changed_file.txt")]);

Dependencies

~5–20MB
~250K SLoC