ITeye博客

ubuntu下之crontab

labreeze · 2012-09-27 20:22 · 操作系统与软件安装 · 操作系统 · Markdown

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

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。