본문 바로가기

Linux

execution time scheduler 'at'

반응형

** First of all, you need to install 'at' via**

$ sudo apt-get install at

 

1. Check current system time

$ date

fri nov 11 15:50:58 -03 2022

 

2. reservate execution time throught 'at' command

$ at 15:52 -f ./myscript.sh

warning: commands will be executed using /bin/sh job 4 at Fri Nov 11 15:52:00 2022

 

** more examples **

$ at now + 1 min -f ./myscript.sh

 

3. list of queued task

$ atq 

3        Fri Jun 23 08:56:00 2023 = username

 

4. remove a queued task

$ atrm <task number>

 

You can specify the runtime in different ways, such as:

  • Time:
    • HH:MM
    • HHMM
    • 12-hour format (am or pm)
    • midnight
    • noon
    • teatime
  • Date:
    • MMDD[CC]YY
    • MM/DD/[CC]YY
    • DD.MM.[CC]YY
    • [CC]YY-MM-DD
    • today
    • tomorrow
    • weekday
  • Increment
    • now + count time-units, where the time-units can be minutes, hours, days, or weeks