LinuxSir.cn,穿越时空的Linuxsir!

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

麻烦大家帮我看看我的crontab文件有什么问题

[复制链接]
发表于 2005-11-16 23:29:57 | 显示全部楼层 |阅读模式

  1. SHELL=/bin/bash
  2. PATH=/sbin:/bin:/usr/sbin:/usr/bin
  3. MAILTO=root
  4. HOME=/

  5. # run-parts
  6. 01 * * * * root run-parts /etc/cron.hourly
  7. 02 4 * * * root run-parts /etc/cron.daily
  8. 22 4 * * 0 root run-parts /etc/cron.weekly
  9. 42 4 1 * * root run-parts /etc/cron.monthly

  10. # These are used to auto shutdown!

  11. # These three commands is for Firday & Saturday:
  12. 45 23 * * 5-6 wall "The system is going to shutdown in 5 minutes."
  13. 46 23 * * 5-6 wall "Save your works and logout NOW"
  14. 50 23 * * 5-6 init 0

  15. # These are for the rest:
  16. 15 23 * * 0-4 wall "The system is going to shutdown in 5 minutes."
  17. 16 23 * * 0-4 wall "Save your works and logout NOW"
  18. 20 23 * * 0-4 init 0
复制代码


周五周六23:50关机,其它时间23:20关。
以前我用at写了一个脚本,运行得很好。现在想用cron来做。但是,wall信息出不来,也没有能够在设定的时间关机。请帮我看看错在哪里?
 楼主| 发表于 2005-11-16 23:32:06 | 显示全部楼层
上面是/etc/crontab文件内容,crond已经启动了。除了编辑这个文件,还要做什么?
回复 支持 反对

使用道具 举报

发表于 2005-11-17 15:07:04 | 显示全部楼层
* * * * * 用户名(如root) 命令(shutdown)
回复 支持 反对

使用道具 举报

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

本版积分规则

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