centos 下自动备份redmine 数据

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

posted @ 2011-11-09 14:31  家中慢步  阅读(710)  评论(0编辑  收藏  举报