Linux crontab 命令格式与详细例子
基本格式 : * * * * * command 分 时 日 月 周 命令 第 1 列表示分钟 1~59 每分钟用或者 /1 表示 第 2 列表示小时 1~23(0 表示 0 点) 第 3 列表示日期 1~31 第 4 列表示月份 1~12 第 5 列标识号星期 0~6(0 表示星期天) 第 6 列要运行的命令 crontab 文件的一些例子: 30 21 * * * /usr/local/etc/rc.d/lighttpd restart 上面的例子表示每晚的 21:30 重启 apache。 45 4 1,10,22 * * /usr/local/etc/rc.d/lighttpd restart 上面的例子表示每月 1、10、22 日的 4 : 45 重启 apache。 10 1 * * 6,0 /usr/local/etc/rc.d/lighttpd restart 上面的例子表示每周六、周日的 1 : 10 重启 apache。 0,30 18-23 * * * /usr/local/etc/rc.d/lighttpd restart 上面的例子表示在每天 18 : 00 ...



