at命令无法执行

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
头像
AMAILS
帖子: 41
注册时间: 2008-04-21 21:56

at命令无法执行

#1

帖子 AMAILS » 2008-05-18 23:09

想系统地问一下关于at命令的问题,我用at命令是这样的:
at now + 1 minutes
warning: commands will be executed using /bin/sh
at>firefox
at><EOT>
job 5 at Sun May 18 21:56:00 2008
这样应该就设置好了吧,但是到点了没有启动程序。
我后来又定时执行echo "HELLO WORLD!",到点了也没有显示出来。
我用at -l 显示任务添加了。
在论坛里搜索了一下,也有两位网友问的,结果也不了了之。
网上也没有说这样的问题。
请问一下这到底哪里出了问题?
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

#2

帖子 eexpress » 2008-05-18 23:11

服务启动了吗?
● 鸣学
dbzhang800
帖子: 3182
注册时间: 2006-03-10 15:10
来自: xi'an China
联系:

#3

帖子 dbzhang800 » 2008-05-18 23:13

如果你定时执行 重启(reboot) ,停止网络(/etc/init.d/networking stop) 等命令话,你就会发现它起作用了。
头像
AMAILS
帖子: 41
注册时间: 2008-04-21 21:56

#4

帖子 AMAILS » 2008-05-18 23:19

看见网上说运行
/etc/rc.d/crond restart 重启那个守护进程,但试了一下却bash: /etc/rc.d/crond: No such file or directory
到目录下面找了一下果然没有rc.d这个目录,只有rc0.d,rc1.d,rc2.d……这些目录里都没有crond restart
可以告诉我ubuntu下怎样开启这个服务么?谢谢!
头像
AMAILS
帖子: 41
注册时间: 2008-04-21 21:56

#5

帖子 AMAILS » 2008-05-18 23:31

又看见/sbin/service crond start也是bash: /etc/rc.d/crond: No such file or directory
我本来想在9:00设置12:00开始下载的(因为室友在玩魔兽世界,下东西会卡死他的)
现在都快12点了,唉~囧,明天还有课,还是关机睡觉~
头像
AMAILS
帖子: 41
注册时间: 2008-04-21 21:56

#6

帖子 AMAILS » 2008-05-18 23:33

/etc/init.d/crond start
bash: /etc/rc.d/crond: No such file or directory
绝望了~
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

#7

帖子 eexpress » 2008-05-18 23:38

/etc/init.d/atd
● 鸣学
头像
AMAILS
帖子: 41
注册时间: 2008-04-21 21:56

#8

帖子 AMAILS » 2008-05-19 11:47

服务是重启了,但是到点还是没有执行。
amai@ubuntu:~$ sudo /etc/init.d/atd restart
[sudo] password for amai:
* Stopping deferred execution scheduler atd [ OK ]
* Starting deferred execution scheduler atd [ OK ]
amai@ubuntu:~$ at 11:27
warning: commands will be executed using /bin/sh
at> firefox
at> <EOT>
job 14 at Mon May 19 11:27:00 2008
amai@ubuntu:~$ at -l
14 Mon May 19 11:27:00 2008 a amai
amai@ubuntu:~$ at -l
amai@ubuntu:~$ at -l
dbzhang800
帖子: 3182
注册时间: 2006-03-10 15:10
来自: xi'an China
联系:

#9

帖子 dbzhang800 » 2008-05-19 12:03

AMAILS 写了:服务是重启了,但是到点还是没有执行。
amai@ubuntu:~$ sudo /etc/init.d/atd restart
[sudo] password for amai:
* Stopping deferred execution scheduler atd [ OK ]
* Starting deferred execution scheduler atd [ OK ]
amai@ubuntu:~$ at 11:27
warning: commands will be executed using /bin/sh
at> firefox
at> <EOT>
job 14 at Mon May 19 11:27:00 2008
amai@ubuntu:~$ at -l
14 Mon May 19 11:27:00 2008 a amai
amai@ubuntu:~$ at -l
amai@ubuntu:~$ at -l
把firefox命令换成reboot看看命令会不会执行
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

#10

帖子 eexpress » 2008-05-19 12:08

你起fx啊。需要设置export DISPLAY=:0 && firefox的啊。
要不,找不到显示的啊。
● 鸣学
头像
AMAILS
帖子: 41
注册时间: 2008-04-21 21:56

#11

帖子 AMAILS » 2008-05-19 12:12

可是运行echo “HELLO WORLD”也没有用
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

#12

帖子 eexpress » 2008-05-19 12:14

X的软件,需要找到显示位置的啊。
有可能你开了10个X。软件不知道到哪里去接口显示的。
echo当然也没地方。你试试
touch ~/AMAILS

呵呵
● 鸣学
头像
AMAILS
帖子: 41
注册时间: 2008-04-21 21:56

#13

帖子 AMAILS » 2008-05-19 12:22

amai@ubuntu:~$ at 12:15
warning: commands will be executed using /bin/sh
at> reboot
at> <EOT>
job 15 at Mon May 19 12:15:00 2008
amai@ubuntu:~$ at -l
reboot也失败了
头像
AMAILS
帖子: 41
注册时间: 2008-04-21 21:56

#14

帖子 AMAILS » 2008-05-19 12:27

算了吧,还是感谢大家都来帮助我。谢谢~
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

#15

帖子 eexpress » 2008-05-19 12:28

reboot你没权限的啊。

还是试试那touch吧。
● 鸣学
回复