====== rclone backblaze backup script ======
Change the values in '{{ }}' placeholders for this to work.
This is an interactive script that waits for month_day values of your previous backups in order to delete.
#!/bin/bash
# Edit the URL of your notification server
notification_url="https://{{notification-server-URL}}/message?token={{topic-token}}"
# List previous backups
rclone lsf {{remote-name}}:
# Set the date (that is included in the filename) of the previous backups to be deleted
read -p "Date of previous backups to delete (eg. 07_27)? " deldate
# First we copy the .zst backups created in the last day and limit upload to 0.7M
echo "Staring upload of lxc backups to Backblaze."
rclone copy /{{path/to/backups}} {{remote-name}}:/ -vP --include "*.zst" --max-age 1d --bwlimit 0.7M
# Then we delete older backup according to date in their name and cleanup backblaze
echo "Deleting older backups from Backblaze."
rclone delete --include "*$deldate*" {{remote-name}}:
rclone cleanup {{remote-name}}:
# Finally we send a notification that the job was done
curl -X POST "$notification_url" -F "title=Backblaze backup progress" -F "message=Backblaze backups have been uploaded" -F "priority=5"
echo "Done."