Refactor scripts

This commit is contained in:
dwrz
2023-02-01 20:11:39 +00:00
parent b895528fba
commit 8024b1df13
2 changed files with 6 additions and 3 deletions
+6 -2
View File
@@ -3,11 +3,15 @@
readonly BUCKET="${B2_BUCKET}"
main() {
local filepath="$1"
local name
name="$(basename "${filepath}")"
backblaze-b2 upload-file \
--threads 2 \
"${BUCKET}" \
"${PROJECT}/motion/${name}.jpg" \
"${HOSTNAME}/timelapse/$1"
"${HOME}/timelapse/${name}" \
"${HOSTNAME}/timelapse/${name}"
# Delete outdated files.
# This assumes the timelapse is created on an hourly basis.