Created
May 28, 2019 17:18
-
-
Save chazlarson/9c95133e39b9c27384aed95280a722ef to your computer and use it in GitHub Desktop.
Sync two rclone remotes, cycling through a set of service accounts at 500GB each. Assumptions here are: you have 100 service accounts. Their JSON credential files are named `sa-1.json` through `sa-100.json` and are stored in `/opt/sa-json`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| COUNTER=1 | |
| SOURCE="remote:path" | |
| DESTINATION="remote:path" | |
| JSON_LOC="/opt/sa-json" | |
| while [ $COUNTER -lt 100 ]; do | |
| echo Using service account sa-$COUNTER | |
| /usr/bin/rclone sync -v --delete-excluded \ | |
| --fast-list --checkers=32 --transfers=16 --max-transfer 500G \ | |
| --stats 5s --drive-service-account-file=$JSON_LOC/sa-$COUNTER.json \ | |
| --log-file=sync.log --drive-chunk-size 64M \ | |
| $SOURCE $DESTINATION | |
| let COUNTER=COUNTER+1 | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment