Post History
The traditional way on a *nix system to run a one-time command at some specified future time is at. $ at 'now + 10 minutes' at Wed Aug 23 19:00:00 2023 at> date >> ~/current-time at>...
Answer
#2: Post edited
**The traditional way on a \*nix system to run a command at some future time is `at`.**- $ at 'now + 10 minutes'
- at Wed Aug 23 19:00:00 2023
- at> date >> ~/current-time
- at> ^D
- job NNN at Wed Aug 23 19:00:00 2023
- $
- You can also specify a particular time, which will be interpreted as "next time the real time is X":
- $ at '16:00'
- at Wed Aug 24 16:00:00 2023
- ...
- or a date and time, although the syntax is a little peculiar:
- $ at '22:00 Aug 29'
- at Tue Aug 29 22:00:00 2023
- ...
- $ at '22:00 Jul 29'
- at Mon Jul 29 22:00:00 2024
- ...
- $ at '22:00 Jul 29 2025'
- at Tue Jul 29 22:00:00 2025
- ...
- Normally, after the job finishes executing, any output (stdout or stderr) will be delivered in an email to the account which scheduled the job.
- I do believe that most `at` implementations will start executing the job *as soon as the specified time has occurred*. So if the system is powered off, or `atd` otherwise isn't running, at the specified time, the job will execute the next time `atd` is started.
- At least on a typical Debian system, it's also possible to pipe a command into `at` to schedule it; for example:
- $ echo date | at 'now + 10 minutes'
- will run `date` after approximately ten minutes.
- To see which jobs are queued for execution, use `atq`. To see what a job will do when it is executed, use `at -c $JOBID`. To delete a job, use `atrm $JOBID`.
- **The traditional way on a \*nix system to run a one-time command at some specified future time is `at`.**
- $ at 'now + 10 minutes'
- at Wed Aug 23 19:00:00 2023
- at> date >> ~/current-time
- at> ^D
- job NNN at Wed Aug 23 19:00:00 2023
- $
- You can also specify a particular time, which will be interpreted as "next time the real time is X":
- $ at '16:00'
- at Wed Aug 24 16:00:00 2023
- ...
- or a date and time, although the syntax is a little peculiar:
- $ at '22:00 Aug 29'
- at Tue Aug 29 22:00:00 2023
- ...
- $ at '22:00 Jul 29'
- at Mon Jul 29 22:00:00 2024
- ...
- $ at '22:00 Jul 29 2025'
- at Tue Jul 29 22:00:00 2025
- ...
- Normally, after the job finishes executing, any output (stdout or stderr) will be delivered in an email to the account which scheduled the job.
- I do believe that most `at` implementations will start executing the job *as soon as the specified time has occurred*. So if the system is powered off, or `atd` otherwise isn't running, at the specified time, the job will execute the next time `atd` is started.
- At least on a typical Debian system, it's also possible to pipe a command into `at` to schedule it; for example:
- $ echo date | at 'now + 10 minutes'
- will run `date` after approximately ten minutes.
- To see which jobs are queued for execution, use `atq`. To see what a job will do when it is executed, use `at -c $JOBID`. To delete a job, use `atrm $JOBID`.
#1: Initial revision
**The traditional way on a \*nix system to run a command at some future time is `at`.** $ at 'now + 10 minutes' at Wed Aug 23 19:00:00 2023 at> date >> ~/current-time at> ^D job NNN at Wed Aug 23 19:00:00 2023 $ You can also specify a particular time, which will be interpreted as "next time the real time is X": $ at '16:00' at Wed Aug 24 16:00:00 2023 ... or a date and time, although the syntax is a little peculiar: $ at '22:00 Aug 29' at Tue Aug 29 22:00:00 2023 ... $ at '22:00 Jul 29' at Mon Jul 29 22:00:00 2024 ... $ at '22:00 Jul 29 2025' at Tue Jul 29 22:00:00 2025 ... Normally, after the job finishes executing, any output (stdout or stderr) will be delivered in an email to the account which scheduled the job. I do believe that most `at` implementations will start executing the job *as soon as the specified time has occurred*. So if the system is powered off, or `atd` otherwise isn't running, at the specified time, the job will execute the next time `atd` is started. At least on a typical Debian system, it's also possible to pipe a command into `at` to schedule it; for example: $ echo date | at 'now + 10 minutes' will run `date` after approximately ten minutes. To see which jobs are queued for execution, use `atq`. To see what a job will do when it is executed, use `at -c $JOBID`. To delete a job, use `atrm $JOBID`.