- Learning Linux Shell Scripting
- Ganesh Sanjiv Naik
- 229字
- 2021-08-20 10:44:30
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 theat
job. The task will be executed at 11.15 A.M. This command will log messages to thelog.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
推薦閱讀
- Visual Basic .NET程序設(shè)計(第3版)
- Learning Flask Framework
- 區(qū)塊鏈架構(gòu)與實現(xiàn):Cosmos詳解
- DevOps入門與實踐
- SEO智慧
- Mastering Kali Linux for Web Penetration Testing
- MySQL數(shù)據(jù)庫管理與開發(fā)(慕課版)
- C語言程序設(shè)計
- MATLAB定量決策五大類問題
- Java編程技術(shù)與項目實戰(zhàn)(第2版)
- 精通Linux(第2版)
- Mastering Data Mining with Python:Find patterns hidden in your data
- Java編程從入門到精通
- Python趣味編程與精彩實例
- 網(wǎng)絡(luò)數(shù)據(jù)采集技術(shù):Java網(wǎng)絡(luò)爬蟲實戰(zhàn)