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

Understanding "at"

Many a time, 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 use of the at command. To use the at command, the syntax is as follows:

    $ at time date

The following are examples of the at command:

  • The Ctrl + 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 email 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 that 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
主站蜘蛛池模板: 庄浪县| 台北县| 年辖:市辖区| 平舆县| 广丰县| 福鼎市| 宝坻区| 理塘县| 桑日县| 景德镇市| 大足县| 章丘市| 长海县| 剑阁县| 仙居县| 汉源县| 汪清县| 东明县| 恭城| 南靖县| 宣恩县| 广东省| 阿图什市| 辉南县| 芦山县| 栾川县| 兰溪市| 太和县| 临颍县| 瑞安市| 金坛市| 英山县| 色达县| 普定县| 金阳县| 延吉市| 朝阳区| 崇信县| 长沙县| 陈巴尔虎旗| 麦盖提县|