ubuntu下之crontab


mysql备份
先进入root
编辑文件
mysql_bak.sh内容
mysqldump -u root -p123456 test > /home/fesco/scripts/$(date +%Y%m%d)-mysql-test.sql
设定每分钟的备份
crontab -e   
* * * * * /home/fesco/scripts/mysql_bak.sh
重启crontab
/etc/init.d/cron  restart


定时关机

vim /etc/crontab  
30 5 * * * root init 6

重启crontab
/etc/init.d/cron  restart






猜你喜欢

转载自labreeze.iteye.com/blog/1687626
今日推荐