Add sync script

This commit is contained in:
dwrz
2022-10-28 17:16:24 +00:00
parent 6db048a5db
commit 4b7df3b3e6
Executable
+17
View File
@@ -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 "$@"