crontab 服务开启状态的 查看是何
/sbin/service crond start ##有说是用这命令启动的,可显示是未知的服务 闷闷
sudo gedit /etc/crontab 按 分 时 天 月 周 命令 的格式 加上了 shutdown -h now 或halt
可是 为什么不执行呢
WIKI也看了 简直是一塌糊涂 这个问题已搜了两天了,要求用VI编辑的真是头大啊 这LINUX昨这样难呢
ubuntu 每天定时关机的实现,网上搜了一大堆,还是云里雾里
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
-
- 帖子: 74
- 注册时间: 2008-09-16 20:50
ubuntu 每天定时关机的实现,网上搜了一大堆,还是云里雾里
上次由 pinpaixie 在 2010-05-09 22:55,总共编辑 1 次。
-
- 帖子: 18311
- 注册时间: 2008-01-09 22:41
- monk
- 帖子: 19507
- 注册时间: 2010-01-28 10:45
Re: ubuntu 每天定时关机的实现,网上搜了一大堆,还是云里雾里
shutdown halt 要sudo 还要密码
天上的雨、地下的水、一阵风吹过
*********宁静致远*********
如果我说的有什么不对,请看签名第一行
*********宁静致远*********
如果我说的有什么不对,请看签名第一行
- ioiogl
- 帖子: 205
- 注册时间: 2007-06-27 17:11
-
- 帖子: 74
- 注册时间: 2008-09-16 20:50
Re: ubuntu 每天定时关机的实现,网上搜了一大堆,还是云里雾里
3L sudo 可以 密码放哪啊
给个例子好吗
下面是我的 /etc/crontab 中的内容
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user command
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
16 22 * * * root shutdown -h now
给个例子好吗
下面是我的 /etc/crontab 中的内容
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user command
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
16 22 * * * root shutdown -h now