Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

In Linux, the batch command schedules non-urgent tasks to run when the system's load

average is low. Instead of executing immediately, it queues commands and runs them when the
load average drops below a threshold (typically 1.5).

Usage:

Bash

batch
command1
command2
...
Ctrl+D

Example:

Bash

batch
tar -czf backup.tar.gz /home/user/documents
echo "Backup completed" | mail -s "Backup Report" user@example.com

Key points:

● Ideal for non-time-critical tasks.


● Optimizes system resources by running tasks during idle periods.
● View pending jobs with atq.
● Remove jobs from the queue with atrm followed by the job number.

You might also like