CentOS command-at: Execute the task at the specified time
Execute the task at the specified time.
Command Format
At [-V] [-q queue] [-f file] [-mldbv] TIME
At [-V] [-q queue] [-f file] [-mldbv]-t time_arg
At-c job [job...]
Command Parameters
-V
Print the version number on the standard error stream
-Q queue
Use the specified queue. A queue is named with A single letter. Valid names include a-z and A-Z. The default queue of the at command is a, and the default queue of the batch command is B. The higher the letter order, the lower the queue priority. The special queue "=" is reserved for the task currently being executed.
-M
When the task is completed, an email is sent to the user even if no output is made.
-F
Reads tasks from the specified file rather than the standard output.
-L
List the at tasks of the current user. For the root user, the at list of all users is listed.
-D
Delete a task by task number.
-V
Displays the time when the task is to be executed.
-C
Connect the jobs listed in the command line and output them to the standard output.
-T time_arg
Specifies the running time of the task time_arg. The format of time_arg is [[CC] YY] MMDDhhmm.
Instance
A) execute the task in 10 minutes
huey@huey-K42JE:~$ at now + 5 minutesat> echo 'hello world' >> at.outat> <EOT>job 3 at Tue May 12 22:16:00 2015
B. Execute the task at four o'clock P.M., 3 days later.
huey@huey-K42JE:~$ at 4pm + 3 daysat> echo 'hello world' >> at.outat> <EOT>job 4 at Fri May 15 16:00:00 2015
C. Execute the task at ten o'clock A.M. on January 1, July 31.
huey@huey-K42JE:~$ at 10am Jul 31at> echo 'hello world' >> at.outat> <EOT>job 5 at Fri Jul 31 10:00:00 2015
D. Execute the task at tomorrow morning.
huey@huey-K42JE:~$ at 1am tomorrowat> echo 'hello world' >> at.outat> <EOT>job 7 at Wed May 13 01:00:00 2015
E) execute the task at four o'clock P.M. on Wednesday.
huey@huey-K42JE:~$ at 4pm WEDat> echo 'hello world' >> at.outat> <EOT>job 8 at Wed May 13 16:00:00 2015
F) execute the task at 12:00:00, May 20 ,.
huey@huey-K42JE:~$ at -t "201505201200"at> echo 'hello world' >> at.outat> <EOT>job 9 at Wed May 20 12:00:00 2015
G) list the at tasks of the current user
huey@huey-K42JE:~$ atq9Wed May 20 12:00:00 2015 a huey8Wed May 13 16:00:00 2015 a huey6Tue May 12 22:21:00 2015 a huey5Fri Jul 31 10:00:00 2015 a huey4Fri May 15 16:00:00 2015 a huey7Wed May 13 01:00:00 2015 a huey
H) delete a task numbered 6
huey@huey-K42JE:~$ atrm 6
Related commands
Atq-is equivalent to at-l
Atrm-equivalent to at-d
Batch-when the system load permits, that is, when the average load is less than 0.8, the task is executed. Its usage is similar to that of the at command.
Other items
- For more information about the time, see the/usr/share/doc/at-3.1.10/timespec file.