Better cron for backups.

This commit is contained in:
Ivaylo Novakov 2021-04-13 12:17:41 +02:00
commit cdf736437f
No known key found for this signature in database
GPG Key ID: 06B9354AB08BE9C6
2 changed files with 3 additions and 0 deletions

View File

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
echo "\n\n`date +"%Y-%m-%d-%H%M"` Starting a DB backup.\n"
# Get current script directory (pwd doesn't cut it) # Get current script directory (pwd doesn't cut it)
csd=$(cd -P -- "$(dirname -- "$0")" && pwd -P) csd=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
# Set the environment. We only grab the entries we need because otherwise we # Set the environment. We only grab the entries we need because otherwise we

View File

@ -2,3 +2,4 @@
0 0,8,16 * * * /home/user/skynet-webportal/setup-scripts/log-checker.py /home/user/skynet-webportal/.env sia 8 0 0,8,16 * * * /home/user/skynet-webportal/setup-scripts/log-checker.py /home/user/skynet-webportal/.env sia 8
0 * * * * /home/user/skynet-webportal/setup-scripts/health-checker.py /home/user/skynet-webportal/.env sia 1 0 * * * * /home/user/skynet-webportal/setup-scripts/health-checker.py /home/user/skynet-webportal/.env sia 1
30 */4 * * * /home/user/skynet-webportal/setup-scripts/blocklist-airtable.py /home/user/skynet-webportal/.env 30 */4 * * * /home/user/skynet-webportal/setup-scripts/blocklist-airtable.py /home/user/skynet-webportal/.env
0 4 * * * /home/user/skynet-webportal/scripts/db_backup.sh 1 >> /home/user/skynet-webportal/logs/db_backup_`date +"%Y-%m-%d-%H%M"`.log 2 > &1