This script automatically creates a tar.gz archive of the firefly database and copies it to a secure offsite location.
It does NOT save the encryption key. Store that somewhere else securely (e.g. password manager).
I have firefly-backup running via a daily cronjob.
This restores a .tar.gz backup of the firefly database to a docker volume. The script takes the filename of the backup as an argument and assumes a static location where those files are found.
- 
Modify the files with your preferred settings (BACKUP_TARGET, BACKUP_SOURCE etc). 
- 
Make both files executable and place them in a user executable bin directory, something like /usr/local/bin.chmod +x firefly-restore firefly-backupmv firefly-restore firefly-backup /usr/local/bin
- 
Set a cron job to automatically run the script ln -s /usr/local/bin/firefly-backup /etc/cron.daily/firefly-backup