标签:crontab
调度命令的使用
普通命令执行
[root@xxzx /]# date >> /home/mydate.txt #---------------------------查看效果--------------------------------- [root@xxzx /]# cat /home/mydate.txt Mon Aug 31 07:04:56 EDT 2015
2. 调度命令的执行
[root@xxzx /]# crontab -e no crontab for root - using an empty one * * * * * date >> /home/mydate.txt #分 时 日 月 星期 #* * * * * 代表每分钟 #0 2 * * * 代表每日2:00 #0 2 3 * * 代表每月3号的2:00 #0 2 3 4 * 代表4月3日的2:00 #0 2 * * 0 代表每周一的2:00 #---------------------------查看效果--------------------------------- [root@xxzx /]# cat /home/mydate.txt Mon Aug 31 07:04:56 EDT 2015 Mon Aug 31 07:07:01 EDT 2015 Mon Aug 31 07:08:01 EDT 2015 Mon Aug 31 07:09:01 EDT 2015
3.通过调用执行文件来进行调度命令
[root@xxzx /]# vi /home/mydate.sh date >> /home/mydate2.txt [root@xxzx /]# chmod 744 /home/mydate.sh [root@xxzx /]# crontab -e * * * * * /home/mydate.sh #---------------------------查看效果--------------------------------- [root@xxzx /]# cat /home/mydate2.txt Mon Aug 31 07:14:01 EDT 2015
Linux_5day------------使用crontab调度命令
标签:crontab
原文地址:http://keefe.blog.51cto.com/9548710/1692326