Add sync script
This commit is contained in:
Executable
+17
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
readonly BUCKET="${B2_BUCKET}"
|
||||
|
||||
main() {
|
||||
# Sync the timelapse.
|
||||
backblaze-b2 sync \
|
||||
--threads 2 \
|
||||
"${HOME}/timelapse/" \
|
||||
"b2://${BUCKET}/${HOSTNAME}/timelapse/"
|
||||
|
||||
# Delete outdated files.
|
||||
# This assumes the timelapse is created on an hourly basis.
|
||||
find "${HOME}/timelapse/" -mmin +60 -delete
|
||||
}
|
||||
|
||||
main "$@"
|
||||
Reference in New Issue
Block a user