Linux Know-How provides a collection of introductory texts on often needed Linux skills. |
Home Newbie Guide Basic Operations Job scheduling Scheduled Programs | ||
See also: Background Execution, How do I set up cron? | ||
Search the VIAS Library | Index | ||
Scheduled ProgramsThe at command will execute the command(s) you specify at the date and time of your choice. For example, I could start playing music from my CDROM at 7 o'clock in the morning: at 7:00 cdplay<Ctrl>d
You can list the job you scheduled for execution using: at -l which will give you the numbered list of the jobs waiting. If you changed your mind, you can remove a job from this list. For example: atrm 8 will remove the job with the number eight on the list. I could also schedule a job for execution much later, for example: at 23:55 12/31/00 startx would start my X-windowing system right on time for the new millennium (5 minutes before midnight on 31 of December 2000). If you cannot execute the at command, check if the at daemon ("atd") is loaded (as root, use ntsysv). If you cannot execute the at command as a regular user although it works for root, check if the empty file /etc/at.deny exists and there is no file /etc/at.allow. This should be the default setup and it permits all the users to execute at. If you want only certain users to use at, create a file /etc/at.allow and list these users there. For other options, check: man at If you wish to perform a processor-intensive job in the background when the system load is low, you may choose to use the batch command. For example, I could run setiathome (a program crunching data to help in search of extraterrestrial intelligence, SETI) using: batch at>setiathome<Ctrl>d In this example, I entered the command batch and then, at the "at>" prompt, I entered the command which I wanted to be executed in the background. The job tries to start immediately, but goes ahead only when the system load is under 0.8 You can check the system load by inspecting the contents of the (virtual) file /proc/loadavg . For example: cat /proc/loadavg When a batch job finishes, the output is sent to me via e-mail.
|
||
Home Newbie Guide Basic Operations Job scheduling Scheduled Programs |