首页 > 其他 > 详细

crontab

时间:2015-12-04 22:50:56      阅读:322      评论:0      收藏:0      [点我收藏+]

crontab

系统调度进程。可以使用它在每天的非高峰负荷时间段运行作业,或在一周或一月中的不同时段运行。

at

使用它在一个特定的时间运行一些特殊的作业,或在晚一些的非负荷高峰时
间段或高峰负荷时间段运行。

 

查看当前的任务  crontab -l

创建一个任务

1. crontab -e

2. vim cronscript   and add content eg: 0-59 * * * *  echo `date` >> /home/xxx/cron.output

关于: 0-59 * * * * 格式可参照 /etc/crontab

cat /etc/crontab

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root

# For details see man 4 crontabs

# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * user-name  command to be executed
一共五个* ,在实际的例子中* 可以理解为“每”的意思

0-59 * * * * 可以理解为每一个月的每一天,每一天中的每一个小时,每一小时的每一分钟执行。。。。操作

 

删除crontab任务

crontab -r

 

crontab

原文:http://www.cnblogs.com/cdwodm/p/5020673.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!