Create a script (in the text editor nano Ctrl+X to exit, y/n to save or cancel changes):
sudo nano /etc/cron.daily/redmine
Sample script content:
#!/bin/sh /usr/bin/mysqldump -u root -p<password> redmine_default | gzip > /path/to/backups/redmine_db_`date +%y_%m_%d`.gz rsync -a /var/lib/redmine/default/files /path/to/backups/files
Let’s make the script executable:
chmod +x /etc/cron.daily/redmine
In the script, you can also add the command to delete old files or directories so that the disk does not overflow, see my article – Script to delete old files
See also other my articles about backup – Backup