Project

General

Profile

Actions

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 <DB_user> -p<pasword> <DB_name> > /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 11 months ago · 2 revisions