分页: 1 / 1

at的问题

发表于 : 2006-10-24 19:42
eexpress
$● echo 'echo "now"'|at 1:14 TODAY
warning: commands will be executed using /bin/sh
job 5 at Tue Oct 24 01:14:00 2006

/usr/share/doc/at/timespec是时间的写法
/var/spool/cron/atjobs/有2个任务。

-------
但是时间到了,没看到反应。都启动了5个任务了。其中都有脚本的。

发表于 : 2006-10-26 0:12
Guo R.H
我也是,按照书上做的就是没有反应的

发表于 : 2006-11-06 10:52
Zelgadiss
at and batch read commands from standard input or a specified file which are to be executed at a later time, using the shell set by the user’s environment variable SHELL, the user’s login shell, or ultimately /bin/sh.

这个是 man at的说明
虽然at 是用来 executes commands at a specified time
但它只是shell的内嵌命令

也就是说,如果你把它写在登陆脚本或者是某段脚本中都可以,但是在外部调用时不可以
注:这里的登录脚本是指 bashrc 这些 shell 初始化脚本

Re: at的问题

发表于 : 2006-11-12 7:12
laborer
eexpress 写了:$● echo 'echo "now"'|at 1:14 TODAY
warning: commands will be executed using /bin/sh
job 5 at Tue Oct 24 01:14:00 2006

/usr/share/doc/at/timespec是时间的写法
/var/spool/cron/atjobs/有2个任务。

-------
但是时间到了,没看到反应。都启动了5个任务了。其中都有脚本的。
at执行命令的输出是不显示在控制台上的,你可以试试这个命令

代码: 全选

at now + 1 minutes <<<"touch test"
看看1分钟以后会不会建一个test文件。