yum install crontabs ( for not found with centos )
crontab -l
crontab -e
0 0 * * * mysqldump -u root -ppassword redmine > /home/pointermans/backup/redmine/$(date +\%Y-\%m-\%d)_redmine_db_backup.sql
vi /etc/cron.allow ( add user for allow )
/etc/init.d/crond restart
sample >
0 0 * * * mysqldump -u root -pabwmthvmxm.co.kr redmine > /home/pointermans/backup/redmine/$(date +\%Y-\%m-\%d)_redmine_db_backup.sql
0 0 * * * tar -czvf /home/pointermans/backup/redmine/$(date +\%Y-\%m-\%d)_redmine_file_backup.tar.gz /var/lib/redmine/files
23 15 * * 0 tar -czvf /home/pointermans/backup/redmine/$(date +\%Y-\%m-\%d)_git_backup.tar.gz /home/git
0 0 * * * find /home/pointermans/backup/redmine/ -type f -name "*.*" -mtime +5 -exec rm {} \;
============
stop & disable
============
/etc/init.d/crond stop
mv /var/spool/cron /var/spool/cron_is_disabled
댓글 없음:
댓글 쓰기