官术网_书友最值得收藏!

Understanding "at"

Many a times we need to schedule a task for a future time, say in the evening at 8 P.M. on a specific day. We can use the at command in such a situation.

Sometimes we need to repeat the same task at a specific time, periodically, every day, or every month. In such situations, we can use the crontab command.

Let's learn more about the utility of the at command. To use the at command, the syntax is as follows:

$ at time date

The following are the examples of the at command:

  • The Control + D command will save the at job. The task will be executed at 11.15 A.M. This command will log messages to the log.txt file at 11.15 A.M.:
    $ at 11.15 AM
    at > echo "Hello World" > $HOME/log.txt
    at > Control + D
    
  • The following command will send an e-mail on March 31, 2015 at 10 A.M.:
    $ at 10am mar 31 2015
    at> echo "taxes due" | mail jon
    at> ^D
    
  • The following command will make the task run on May 20 at 11 A.M.:
    $ at 11 am may 20
    
  • All the jobs which are scheduled by the at command can be listed using the following command:
    $ atq
    
  • To remove a specific job listed by the atq command, we can use the following command:
    $ atrm job-id
    
主站蜘蛛池模板: 朝阳区| 宿迁市| 皋兰县| 英超| 西青区| 南川市| 东丰县| 航空| 横峰县| 津市市| 渭南市| 融水| 新巴尔虎左旗| 两当县| 仪征市| 虹口区| 合肥市| 平阴县| 金坛市| 宝应县| 宁城县| 奉贤区| 平乡县| 太白县| 简阳市| 略阳县| 剑川县| 阳山县| 来安县| 平遥县| 和田市| 丰都县| 竹溪县| 泗洪县| 会宁县| 类乌齐县| 麻阳| 广汉市| 泰顺县| 舟曲县| 昌黎县|