at

From NetBSD Wiki

Jump to: navigation, search

With at(1) you can have a shell script executed once at a designated time and day. The difference with cron is, that cron can run a script any number of times at a set time of day, while at just runs it once, at the next time the date is reached.

The syntax is pretty simple. To tell it you want to run find / -name foobar 15 minutes from now, you type

$ at now + 15 minutes
find / -name foobar
^D

The reason you need to press ^D (control+d) is that it acceps a full-blown shellscript on stdin. ^D closes the input and accepts the typed script. If you have the script on file somewhere, you can also supply the -f flag:

$ at -f ./find-foobars now + 1 hour

After starting an at job, you can query the list of at jobs with atq and remove any mistakes with atrm (much like the lp, lpq and lprm family). When the job has executed, it will send a mail containing whatever the script writes to stdout and stderr to the user who started the job, unless there is none.

The time specification at accepts is pseudo-english. You can even supply well-known times like noon, midnight and even teatime (3pm). For the complete accepted syntax, consult the manpage (at(1)).

See also

View source code (Please report any bugs or suggestions here).

Retrieved from "http://wiki.netbsd.se/at"
Personal tools