at Scheduler

at Scheduler –

AT is a scheduler utility and is used for scheduling onetime task unlike cron which is used for scheduling repetitive tasks. “at” jobs are spooled in /var/spool/at/ directory
Commands used in AT Utility
at – run scripts at specified time
atq – displays pending job list of user. When run with” root” id, it will display pending jobs of all users.
atrm – delete job by their job id.

Scheduling AT jobs

Schedule ‘mkdir abcd’ command to be executed at next 10 PM one time
# at 10 pm
At > mkdir abcd
At > ^d
Job 3 at 2016-04-20 22:00
^d used for exiting to prompt

Run a job on next 5 AM
# at 05:00 AM

Run a job at 7 PM coming Monday
# at 07:00 PM Monday

Run a job at 5 AM coming 27th April
# at 05:00 AM April 27

Run a job at 6 AM coming 30 April 2016
# at 06:00 AM 4/30/2016
# at 06:00 AM 4.20.2016

Run a job to kick off after next 1hr
# at now + 1 hour

Run a job after next 30 minutes
# at now + 30 minutes

Run a job after next 1 and 2nd week
# at now + 1 week
# at now + 2 weeks

Run a job at 5pm tomorrow
# at 05:00 PM tomorrow

Run a job at midnight
# at midnight

Run a job at 4 am on same date next month
# at 04:00 AM next month

Run a job to kick off after 1st year and 2nd year from now

# at now + 1 year
# at now + 2 years

Run a job in next 1day
# at now + 1 day

Run a job at teatime i.e., 4 PM
#at teatime

Permissions to use “at” command

Permission to use at command for a user is administered by the entries in file /etc/at.allow and /etc/at.deny/
• If user entry exists in /etc/at.allow, user can execute at command
• If /etc/at.allow file itself does not exist and user entry is not there in the /etc/at.deny file, then that user is allowed to use at command
• If both /etc/at.allow and /etc/at.deny both files are not present, then only super user is allowed to run the at command

Also read about Crontab Scheduler here