24.4. Scheduling a Job to Run on System Load Drop Using batch
batchutility. This can be useful for performing resource-demanding tasks or for preventing the system from being idle.
batchjobs using the batch utility. The jobs are then executed by the
24.4.1. Prerequisites for Batch Jobs
batchutility is provided in the
batchjobs are managed by the
atdservice. Hence, the prerequisites for
batchjobs are the same as for
atjobs. See Section 24.3.1, “Prerequisites for At Jobs”.
24.4.2. Scheduling a Batch Job
- A job is always run by some user. Log in as the desired user and run:
- At the displayed
at>prompt, enter the command to execute and press Enter:
batchat> sh /usr/local/bin/my-script.shRepeat this step for every command you want to execute.
at>prompt shows which shell it will use:
warning: commands will be executed using /bin/shThe batch utility uses the shell set in user's SHELL environment variable, or the user's login shell, or
/bin/sh, whichever is found first.
- Press Ctrl+D on an empty line to finish specifying the job.
Changing the Default System Load Average Limit
batchjobs start when system load average drops below 0.8. This setting is kept in the
atqservice. To change the system load limit:
- To the
/etc/sysconfig/atdfile, add this line:
OPTS='-l x'Substitute x with the new load average. For example:
- Restart the
systemctl restart atq
Viewing Pending Jobs
atqcommand. See the section called “Viewing Pending Jobs”.
Deleting a Scheduled Job
atrmcommand. See the section called “Deleting a Scheduled Job”.
Controlling Access to Batch
batchutility. This is done for the
atutilities together. See Section 220.127.116.11, “Controlling Access to At and Batch”.