At (Unix)


For other uses of this term, see at.

at is a tool that allows you to program the execution of one or more programs at a future time.

The normal syntax of at is at [hour: minute [day.month]]

The instructions to be performed are read by the standard input (stdin) and executed at the indicated time. As usual, the list of instructions must end with the EOF character, usually Control-D. If only the hour / minute is indicated, it will be executed when it is reached (on the current day or the next). If a date is specified, a time will necessarily be specified.

The results that the program shows by the standard output (stdout) or the error output (stderr) will be sent by email to the user who invoked at.

The at -l instruction allows you to list the programmed executions of at. The at -d instruction allows you to delete one or more. The instruction at -f file hour: minute will execute in the programmed moment the instructions contained in the indicated file, instead of reading them by the standard input.

Examples at 10:15 > reboot > ^D

... will schedule a reboot at the indicated time: 10 hours 15 minutes in the morning.

The instruction: at 12.12.2106 21:23 > /etc/init.d/apache stop > sleep 600 > /etc/init.d/apache start > ^D

... will run on December 12, 2106 at 9 and 23 in the afternoon. It will stop the apache web server, wait 10 minutes and restart it.

The instruction: at -l

... will list the scheduled jobs.

cron



wiki