LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 740|回复: 1

请教大家关于使用crontab,定时执行校准服务器时间的问题,谢谢!

[复制链接]
发表于 2005-7-16 00:38:57 | 显示全部楼层 |阅读模式
使用的是超级用户 root
设置好后,我用crontab -l  命令查看,显示的是
1 * * * * ntpdate 192.43.244.18
就是每小时的第1分钟自动执行校准时间,应该没错,但是好像没有起作用,所以想请教一下到底是什么问题呢?

另外单独使用 ntpdate 192.43.244.18  完全正常


请大家指教,谢谢 :thank  :thank
发表于 2005-7-16 00:56:50 | 显示全部楼层
*     *    *    *    *  command to be executed
-    -     -    -    -
|     |     |     |     |
|     |     |     |     +----- day of week (1 - 7) (monday = 1)
|     |     |     +------- month (1 - 12)
|     |     +--------- day of month (1 - 31)
|     +----------- hour (0 - 23)
+------------- min (0 - 59)

You can execute crontab if your name appears in the file
/usr/lib/cron/cron.allow. If that file does not exist, you can use
crontab if your name does not appear in the file
/usr/lib/cron/cron.deny.
If only cron.deny exists and is empty, all users can use crontab. If neither file exists, only the root user can use crontab. The allow/deny files consist of one user name per line.

30 0 1 1,6,12 * -- 00:30 Hrs  on 1st of Jan, June & Dec.
                                                   
0 20 * 10 1-5 --8.00 PM every weekday (Mon-Fri) only in Oct.
                                                   
0 0 1,10,15 * * -- midnight on 1st ,10th & 15th of month
                                                   
5,10 0 10 * 1 -- At 12.05,12.10 every Monday & on 10th of every month

you can also try to use '/' as 'per'...
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表