Created
February 28, 2020 19:01
Revisions
-
optimistic5 created this gist
Feb 28, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ #!/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