Task Automation using ‘at’ service

Share

Scheduling one-time tasks has never been easier than using ‘at’ service.

Time format of ‘at’:

Few examples and their meaning:

$at 8pm Next upcoming 8pm
$at 20:00 Same as above
$at 9am Sunday Upcoming Sunday, 9 am
$at 5pm December 31 Upcoming 31st December, 5pm
$at 9am January 1 2018 Jobs can be scheduled, for any year in future
$at now +5 minutes Any time with reference to current time, instead of minutes, we can assign, hours, weeks, days, months, years
$at 4pm
or
$at teatime
These commands have the same effect
$at 12am
or
$at midnight
These commands have similar effect

To install the required package for ‘at’ service, RHEL-7 it is available by default, or else, use the following command(assuming the machine is a yum client).

The service name is atd, must be running and enabled for next reboot.

Otherwise, use the following command in series:


Examples:

Press CTRL+D to save the job and exit from ‘at’ prompt.

The location (spool file) is at /var/spool/at/

Meaning of the name of this file: a followed by 4 Zeros, job_id, least bother the rest. Notice the job_id from the atq  command above.

By default, the output is sent to mail of the user who created the job.

Would You Mind Sharing?

Share
About Dhiraj 52 Articles
Blogger on development, securities, and efficiency on web technologies.

Be the first to comment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.