Files
vigil/scripts/sync
T

19 lines
374 B
Bash
Raw Normal View History

2022-10-28 17:16:24 +00:00
#!/usr/bin/env bash
readonly BUCKET="${B2_BUCKET}"
main() {
2023-02-01 19:51:01 +00:00
backblaze-b2 upload-file \
--threads 2 \
"${BUCKET}" \
"${PROJECT}/motion/${name}.jpg" \
"${HOSTNAME}/timelapse/$1"
2022-10-28 17:16:24 +00:00
# Delete outdated files.
# This assumes the timelapse is created on an hourly basis.
2023-02-01 19:51:01 +00:00
rm -f "$1"
2022-10-28 17:16:24 +00:00
find "${HOME}/timelapse/" -mmin +60 -delete
}
main "$@"