Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/onsails/cloud-storage-sync
Library for syncing local files with Google Cloud Storage buckets
https://github.com/onsails/cloud-storage-sync
gcs google google-cloud google-cloud-storage rsync sync
Last synced: 2 months ago
JSON representation
Library for syncing local files with Google Cloud Storage buckets
- Host: GitHub
- URL: https://github.com/onsails/cloud-storage-sync
- Owner: onsails
- License: mit
- Created: 2020-04-20T01:08:30.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-05-05T09:39:35.000Z (8 months ago)
- Last Synced: 2024-08-10T09:19:04.760Z (5 months ago)
- Topics: gcs, google, google-cloud, google-cloud-storage, rsync, sync
- Language: Rust
- Homepage:
- Size: 97.7 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# cloud-storage-sync
[![docs](https://docs.rs/cloud-storage-sync/badge.svg)](https://docs.rs/cloud-storage-sync)
Library to sync files to, from and between Google Cloud Storage buckets
This project depends on [cloud-storage-rs](https://github.com/ThouCheese/cloud-storage-rs.git) crate.
To access bucket you need to specify `SERVICE_ACCOUNT` environment variable which should contain path to the service account json key.```rust
let force_overwrite = false;
let sync = Sync::new(force_overwrite);for i in 1..=2 {
let op_count = sync.sync_local_to_gcs(
"/some/local/file_or_dir",
BUCKET,
"some/directory",
).await?;
if i == 2 {
assert_eq!(op_count, 0); // passes
}let op_count = sync.sync_gcs_to_local(
BUCKET,
"myprefix",
"../some/directory"
).await?;
if i == 2 {
assert_eq!(op_count, 0); // passes
}
}
```