commit c55372f2f56d3cf07e6e7e4d18012dcb6c4202ea parent bc6f916928f1c985b579a3521cc31371e1b6922d Author: dwrz <dwrz@dwrz.net> Date: Thu, 27 Oct 2022 20:07:24 +0000 Add sync script Diffstat:
A | scripts/sync | | | 17 | +++++++++++++++++ |
1 file changed, 17 insertions(+), 0 deletions(-)
diff --git a/scripts/sync b/scripts/sync @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +readonly 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 "$@"