6 | | * database backups |
7 | | * file upload backups |
| 6 | * database backups |
| 7 | * file upload backups |
| 8 | |
| 9 | === Database backups === |
| 10 | |
| 11 | The databases are backed up by a cronjob which runs as user posgres which currently dumps the production databases twice a day: |
| 12 | |
| 13 | {{{ |
| 14 | root@nmcdsp:~# su - postgres |
| 15 | postgres@nmcdsp:~$ crontab -l |
| 16 | # m h dom mon dow command |
| 17 | 0 13,01 * * * ~/scripts/backup_database.sh gscf-www 2>&1 |
| 18 | 0 13,01 * * * ~/scripts/backup_database.sh nmcdsp-www 2>&1 |
| 19 | 0 13,01 * * * ~/scripts/backup_database.sh sam-www 2>&1 |
| 20 | postgres@nmcdsp:~$ |
| 21 | }}} |
| 22 | |
| 23 | The database dumps are remotely stored on nbx14 in /home/nmcbackups/backups using the scponly nmcbackups account on nbx14. On nbx14 the backups folder is cleaned through another cronjob which runs as user root and keeps at least 5 backups files per environment and additionally keeps all backups that are less than 7 days old. This means that if there are 15 backup files for one product / environment (e.g. gscf-www) that are younger than 7 days, and two that are older than 7 days, only the latter two will be deleted. |
| 24 | |
| 25 | {{{ |
| 26 | root@nbx14:/root# crontab -l |
| 27 | # The NMCDSP.org server has an automated backup process going, storing |
| 28 | # database dumps in the (scponly) useraccount nmcbackup. This script |
| 29 | # 1. cleans up the backup folder |
| 30 | # 2. makes sure a minimal number of backups (per product, per environment) |
| 31 | # are kept |
| 32 | # 3. makes sure backups of a age less than a max age are kept |
| 33 | 30 1,13 * * * /root/scripts/cleanup_backups >> /root/scripts/cleanup_backups.log 2>&1 |
| 34 | root@nbx14:/root# |
| 35 | }}} |