Running scripts at predetermined times

You can use cron to schedule jobs to run at regular time intervals, but to run a script at a particular time and date, use the ‘at’ command.

at TIME [DATE] -f scriptname

where TIME is like 2:30pm or 10:00am, and date is in the format like ‘Mar 10’ or ‘Apr 01’.

To view scripts that are scheduled for execution, use the command: atq

This lists the scripts that are ‘queued’ for execution. The first digit on each line is the job number for each scheduled script. To remove/cancel a scheduled script, use the atrm command, with the job number.

Leave a Reply

Your email address will not be published. Required fields are marked *

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