Daily systemd timer to backup the contents of my filesystem to Backblaze B2. As-written, it will keep up to a year's worth of backups, performing one full backup every month. This script was tested with duplicity 2.1.0.
Create a B2 bucket and an application key with read/write permissions to that bucket. Configure object lock with a sufficiently long period (I use 3x the full backup period) to ensure that ransomware won't be able to nuke your backups. Also ensure the 'list all bucket names' option is enabled (unless you want to use the B2 SDK directly - the S3 SDK requires it for whatever reason). Update env.sh and include.txt with the appropriate values.
# Ensure boto3 python package is installed
# Run the following commands as root
install -Dm600 env.sh /etc/duplicity/
install -Dm644 include.txt /etc/duplicity/
install -Dm644 duplicity-backup.service /etc/systemd/system/
install -Dm644 duplicity-backup.timer /etc/systemd/system/
install -Dm755 duplicity-backup.sh /usr/local/bin/
systemctl enable --now duplicity-backup.timer