Weekly Redmine Production Database Backup » History » Revision 1
Revision 1/2
| Next »
Gareth Eaton, 05/27/2023 12:18 PM
Weekly Redmine Production Database Backup¶
To run the backup command automatically every week, you can set up a cron job. Here's how you can do it:
Open the cron table for editing by running the following command:
crontab -e
If prompted to select an editor, choose your preferred editor (e.g., nano, vim).
In the cron table, add the following line to schedule the backup to run every week:
0 0 * * 0 mysqldump -u redmineuser -pge8227104@NCB redminedb > /root/backups/redmine_production_backup_$(date +\%Y-\%m-\%d).sql
This line specifies that the backup command should run at 12:00 AM (midnight) every Sunday (0 0 * * 0). The backup filename includes the current date.
Save the file and exit the editor.
The cron job is now scheduled to run automatically every week. The backup file will be created in the /root/backups directory with the current date appended to the filename.
Updated by Gareth Eaton over 1 year ago · 1 revisions