注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

随机过程

http://superware.blog.163.com

 
 
 

日志

 
 

Using crontab  

2014-03-27 13:42:48|  分类: 默认分类 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
I)、Two ways to use command crontab

1. Edit a task file, and load it with crontab

for example: vi crontab_task

# echo time to a file every minute
1-59 * * * * echo `date` >> ~/date.txt

then load the file crontab_task by crontab command

crontab crontab_task




2. crontab -e to start a task

crontab -e

then gnu nano will be opened and then you can edit a file and then save it and  named as crontab_task


II)、How to delete a task started by crontab

Two ways to delete a task started by crontab

1. commenting away the task in task list in crontab_task file

for example:
# echo time to a file every minute
# 1-59 * * * * echo `date` >> ~/date.txt
and then execute the file crontab_task, the commented task will not be executed.

2. crontab -r  :  removing all tasks started by crontab command


III)、record in crontab_task file

*  *  *  *  *  unix_command

1 2 3 4 5 6

first: the minute within an hour 0-59
second: the hour within a day 1-23
third: the day within a month 1-31
forth: the month within a year 1-12
fifth: the day within a week 0-6 0-weekend
sixth: command

  评论这张
 
阅读(23)| 评论(0)
推荐

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017