創建、查看、刪除計划任務at命令舉例


1、三天后的下午 5 點執行 /bin/ls :

  at 5pm + 3 days

  at> /bin/ls             結束按ctrl+d

  查看計划任務:at -l 之后 at -c <num>

  刪除計划任務:at  -d  <num>    <num>用at -l 查看

2、三個星期后的下午 5 點執行 /bin/ls :

  at 5pm + 2 weeks

  at> /bin/ls            結束按ctrl+d

  查看計划任務:at -l 之后 at -c <num>

  刪除計划任務:at  -d  <num>    <num>用at -l 查看

3、明天的 17:20 執行 /bin/date :

  at 17:20 tomorrow

  at> /bin/date  結束按ctrl+d

  查看計划任務:at -l 之后 at -c <num>

  刪除計划任務:at  -d  <num>    <num>用at -l 查看

4、2009 年的最后一天的最后一分鍾印出 the end of world !

  (1)at 23:59 [20]09-12-31

      at> echo the end of world !  結束按ctrl+d

  (1)at 23:59 12/31/2009

      at> echo the end of world !  結束按ctrl+d

  (2)at 23:59 1231[20]09

      at> echo the end of world !  結束按ctrl+d

  (3)at 23:59 31.12.[20]09

      at> echo the end of world !  結束按ctrl+d

  查看計划任務:at -l 之后 at -c <num>

  刪除計划任務:at  -d  <num>    <num>用at -l 查看

5、3分鍾,小時,天后打印hello

  (1)at now +3minutes

      at> echo hello  結束按ctrl+d

   (2)at now +3hours

      at> echo hello  結束按ctrl+d

  (3)at now +3days

      at> echo hello  結束按ctrl+d

   查看計划任務:at -l 之后 at -c <num>

   刪除計划任務:at  -d  <num>    <num>用at -l 查看

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM