1. 创建备份路径
mkdir /root/redmineback
2. 修改路径访问权限
chmod 777 /root/redmineback
3. 添加脚本redback.sh,vi /root/redmineback/redback.sh
# 备份文件
rsync -a /var/www/redmine/files /root/redmineback/files
# 备份数据
mysqldump -uroot -d redmine | gzip >/root/redmineback/redmine_`date +%y_%m_%d`.gz
4. 修改/etc/crontab,让脚本自动执行, vi /etc/crontab
添加cron 表达式
01 1 * * * root /root/redmineback/redmineback.sh