A systemd-based solution for scheduling Veeam backup jobs on Linux systems
- Shell 100%
| README.md | ||
| veeam-run-polling | ||
| veeam-run@.service | ||
| veeam-run@.timer | ||
Veeam Systemd Integration
A systemd-based solution for scheduling Veeam backup jobs on Linux systems.
Components
veeam-run-polling
A bash script that:
- Starts a Veeam backup job by name
- Extracts the session ID from the output
- Polls the job status at regular intervals (10 seconds)
- Gracefully handles stop signals
- Reports job completion status (Success, Warning, or Failed)
veeam-run@.service
A systemd service template that:
- Executes the polling script with a specific job name
- Uses
systemd-inhibitto prevent system sleep during backups
veeam-run@.timer
A systemd timer template that:
- Schedules backups to run on the every second day of the month at 10:30 AM
- Persists the schedule across system reboots
- Wakes the system to run the scheduled job
Prerequisites
- Veeam Agent for Linux Free for Linux installed
- Root/sudo access for installation
veeamconfigcommand-line tool available at/usr/bin/veeamconfig- A configured Veeam backup job without a schedule (the systemd timer will handle scheduling)
Installation
1. Copy the Polling Script
Copy the veeam-run-polling script to the system binaries directory:
sudo cp veeam-run-polling /usr/local/bin/
sudo chmod 755 /usr/local/bin/veeam-run-polling
2. Copy the Service Unit Files
Copy the systemd unit files:
sudo cp veeam-run@.service /etc/systemd/system/
sudo cp veeam-run@.timer /etc/systemd/system/
3. Reload Systemd Configuration
After copying the files, reload the systemd daemon:
sudo systemctl daemon-reload
4. Enable the Timer and Service
Enable the systemd timer and service for your backup job:
sudo systemctl enable veeam-run@<job_name>.timer
sudo systemctl enable veeam-run@<job_name>.service
Replace <job_name> with the actual name of your Veeam backup job.
Start the timer to activate scheduled backups:
sudo systemctl start veeam-run@<job_name>.timer