Linux 进行计划任务 at 命令通常只能运行一次. at 通常有后台服务atd支持,如果没有这个服务,将无法使用at ps -ef|grep atd root 1815 1 0 May11 ? 00:00:00 rpc.statd root 2196 1 0 May11 ? 00:00:00 /usr/sbin/atd 500 26893 32184 0 23:09 pts/1 00:00:00 grep atd [windriver@windriver-machine pne2.0]$ /etc/init.d/atd status atd (pid 2196) is running... at创建新的任务不需要root权限,便删除需要root权限 atrm [windriver@windriver-machine ATCA_7150_prj]$ atq 1 Thu Jun 2 23:14:00 2011 = windriver 2 Thu Jun 2 23:20:00 2011 a windriver [windriver@windriver-machine ATCA_7150_prj]$ atq 1 Thu Jun 2 23:14:00 2011 = windriver 2 Thu Jun 2 23:20:00 2011 a windriver [windriver@windriver-machine ATCA_7150_prj]$ atrm 2 Cannot unlink a00002014c64f8: Permission denied [windriver@windriver-machine ATCA_7150_prj]$ atrm 1 Warning: deleting running job Cannot unlink =00001014c64f2: Permission denied [windriver@windriver-machine ATCA_7150_prj]$ su root Password: [root@windriver-machine ATCA_7150_prj]# atq 1 Thu Jun 2 23:14:00 2011 = windriver 2 Thu Jun 2 23:20:00 2011 a windriver [root@windriver-machine ATCA_7150_prj]# atrm 2 [root@windriver-machine ATCA_7150_prj]# atq 1 Thu Jun 2 23:14:00 2011 = windriver [root@windriver-machine ATCA_7150_prj]# atrm 1 Warning: deleting running job [root@windriver-machine ATCA_7150_prj]# atq [root@windriver-machine ATCA_7150_prj]# batch 创建的任务一般是CPU利用低的情况才会执行、
|