Chinaunix首页 | 论坛 | 博客
  • 博客访问: 309516
  • 博文数量: 60
  • 博客积分: 2579
  • 博客等级: 大尉
  • 技术积分: 570
  • 用 户 组: 普通用户
  • 注册时间: 2006-12-17 14:54
文章分类

全部博文(60)

文章存档

2011年(1)

2010年(1)

2009年(35)

2008年(23)

分类:

2009-03-09 16:36:46

 Each crontab file entry consists of a line with six fields, separated by
 spaces and tabs.  The information in the fields specifies when the command
 runs and the name of the command.  The fields specify the following:
   +  The first field specifies the minute (0 to 59).
   +  The second field specifies the hour (0 to 23).
   +  The third field specifies the day of the month (1 to 31).
   +  The fourth field specifies the month of the year (1 to 12).
   +  The fifth field specifies the day of the week (0 to 6 for Sunday to
      Saturday).
   +  The sixth field specifies the shell command to be executed.
 You can specify the following values in the fields that indicate the time:
   +  An integer (within the appropriate range of values)
   +  Two integers separated by a dash to indicate an inclusive range
   +  A list of integers separated by commas
   +  An asterisk to select all possible values
 You can specify the days on which the command is to execute in two fields
 (day of the month and day of the week).  You can specify both fields, or
 you can specify only one field.  To use only one field to specify the days,
 the other field should contain an asterisk (*).  If both methods are used,
 the command is executed whenever either of the specifications is met.
 [Tru64 UNIX]  For example, the following entry runs command at midnight on
 the first and fifteenth days of each month, as well as every Monday:
      0 0 1,15 * 1 command
EXAMPLES
   1.  The following example writes the time to the console every hour on the
       hour:
            0 * * * * echo The hour is `date`. >/dev/console
   2.  The following example runs calendar at 6:30 a.m. every Monday, Wednes-
       day, and Friday:
            30 6 * * 1,3,5 /usr/bin/calendar -
   3.  The following example writes the contents of happyholidays.txt to all
       users logged in at 4:00 p.m. each Friday in December and each day
       between December 10 and December 31 inclusive:
            0 16 10-31 12 5 /usr/sbin/wall /var/tmp/happyholidays.txt
阅读(1146) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~