Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Backup Firefly-III database script
#!/bin/bash
############README
#chmod this script first
#chmod +x create_backup.sh
#Add this script to cron
#crontab -e
#0 0 * * * bash ~/firefly-iii/create_backup.sh
############
#Leave only 5 last backups
ls -1 ~/firefly-iii/db-backup/backup_* | sort -r | tail -n +6 | xargs rm > /dev/null 2>&1
#Create dump of database
docker exec firefly-iii_firefly_iii_db_1 pg_dump -c -h localhost -U firefly homestead > ~/firefly-iii/db-backup/backup_$(date +"%m-%d-%y").sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.