at的问题

sh/bash/dash/ksh/zsh等Shell脚本
回复
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

at的问题

#1

帖子 eexpress » 2006-10-24 19:42

$● 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个任务了。其中都有脚本的。
● 鸣学
Guo R.H
帖子: 87
注册时间: 2006-09-15 19:14

#2

帖子 Guo R.H » 2006-10-26 0:12

我也是,按照书上做的就是没有反应的
Zelgadiss
帖子: 8
注册时间: 2006-11-06 10:25

#3

帖子 Zelgadiss » 2006-11-06 10:52

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 初始化脚本
头像
laborer
帖子: 1016
注册时间: 2005-10-25 11:15
联系:

Re: at的问题

#4

帖子 laborer » 2006-11-12 7:12

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文件。
hreiser@oakland:~$ killall -9 wife
police@oakland:~$ sudo find / -user hreiser
court@oakland:~$ sudo mv /home/hreiser /jail/
court@oakland:~$ sudo usermod -d /jail/hreiser -s "/usr/sbin/chroot /jail/" hreiser
回复