最近寫了一個程式,需要淩晨1點30運作,但因為這個程式隻運作一次,不必要使用crontab,是以隻用at足矣。
0.先看一下時間
[[email protected] test]# date
2012年 05月 29日 星期二 16:55:15 CST
1.使用at指定時間運作程式。
[[email protected] test]# at -f /var/tmp/test/arc.sh 1:30 5/30/12
job 6 at 2012-05-30 01:30
或者[[email protected] test]# at -f /var/tmp/test/arc.sh now
job 6 at 2012-05-30 01:30
2.首先檢視at是否程式等待運作
[[email protected] test]# at -l
6 2012-05-30 01:30 a root
3.如果要删除(at -r 後面添加編号)
[[email protected] ~]# at -r 1
===================第二種方法======================[[email protected] bin]# at now
at> /usr/local/copydata/bin/test.sh
at>
job 12 at 2012-07-11 12:04
或者