Q. How do I configure batch jobs under Fedora Linux?
A. Linux provides batch and at command using at package. You need to install this package to use at and batch command. These commands read commands from keyboard or a specified file which are to be executed at a later time,
=> at - executes commands at a specified time.
=> atq - lists the user's pending jobs, unless the user is the superuser; in that case, everybody's jobs are listed. The format of the output lines (one for each job) is: Job number, date, hour, job class.
=> atrm - deletes jobs, identified by their job number.
batch executes commands when system load levels permit; in other words, when the load average drops below 1.5, or the value specified in the invocation of atrun.
To execute a one-time task type batch command:
# batch
Now you will see at> prompt.
Type command and press ctrl+d to save job.
According to man page:
At allows fairly complex time specifications, extending the POSIX.2 standard. It accepts times of the form HH:MM to run a job at a specific time of day. (If that time is already past, the next day is assumed.) You may also specify midnight, noon, or teatime (4pm) and you can have a time-of-day suffixed with AM or PM for running in the morning or the evening. You can also say what day the job will be run, by giving a date in the form month-name day with an optional year, or giving a date of the form MMDDYY or MM/DD/YY or DD.MM.YY. The specification of a date must follow the specification of the time of day. You can also give times like now + count time-units, where the time-units can be minutes, hours, days, or weeks and you can tell at to run the job today by suffixing the time with today and to run the job tomorrow by suffixing the time with tomorrow.
For example, to run a job at 4pm three days from now, you would do at 4pm + 3 days, to run a job at 10:00am on July 31, you would do at 10am Jul 31 and to run a job at 1am tomorrow, you would do at 1am tomorrow.
$ at 1am tomorrow
Output:
at> mail me@somewhere.com < /home/vivek/file.txt
Press ctrl+d to save job.
Reboot system at 5am:
$ at 5am
Output:
at> /sbin/reboot
Press ctrl+d to save job.
Read man page of at for more information:
$ man at
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop













{ 1 comment… read it below or add one }
thank you for the explanation of the batch command. The command worked in my hands, however, I could not change the default load average, even though I entered another value with the atrun -l command, batch kept starting at a value of 0.8. Any suggestions? thank you, Ben