This is possible with UrBackup, but requires a clever mix of inclusion/exclusion directives and scheduling policies, because UrBackup doesn’t natively support per-volume backup frequency…
However, with a bit of scripting or client-side override trickery, it’s completely doable…
What you want
Drive |
Backup Frequency |
Notes |
Drive1 |
Daily |
Changes frequently (e.g. /mnt/D1 ) |
Drive2 |
2nd Saturday monthly |
Slow but occasional (e.g. /mnt/D2 ) |
Drive3 |
3rd Saturday monthly |
Same |
Drive4 |
4th Saturday monthly |
Same |
Solution Summary (Client-Side Control)
Use UrBackup’s add-backupdir
and remove-backupdir
client control features to dynamically control which drives are backed up, and pair that with a cron-based schedule…
What stays constant:
- UrBackup server runs backups daily or weekly as per default
- Client determines what is included in each scheduled run
- Drive1 is always included
- Drive2–4 are only added right before their designated Saturday
- Drive2–4 are removed afterward to avoid backups on other days
Step-by-Step Setup
1. Add Drive1 permanently to the client
urbackupclientctl add-backupdir -x /mnt/D1
2. Create scripts to enable/disable the big drives
Example: /usr/local/bin/enable_drive2.sh
urbackupclientctl add-backupdir -x /mnt/D2
And /usr/local/bin/disable_drive2.sh
#!/bin/bash
urbackupclientctl remove-backupdir /mnt/D2
Repeat that step for Drive3 and Drive4.
Make all scripts executable:
chmod +x /usr/local/bin/enable_drive*.sh
chmod +x /usr/local/bin/disable_drive*.sh
3. Add cron jobs
# Drive2 - 2nd Saturday
0 2 * * 6 [ $(date +\%m) -ne $(date -d "$(date +\%Y-\%m-01) +7 days" +\%m) ] && /usr/local/bin/enable_drive2.sh
0 23 * * 6 /usr/local/bin/disable_drive2.sh
# Drive3 - 3rd Saturday
0 2 * * 6 [ $(date +\%m) -ne $(date -d "$(date +\%Y-\%m-01) +14 days" +\%m) ] && /usr/local/bin/enable_drive3.sh
0 23 * * 6 /usr/local/bin/disable_drive3.sh
# Drive4 - 4th Saturday
0 2 * * 6 [ $(date +\%m) -ne $(date -d "$(date +\%Y-\%m-01) +21 days" +\%m) ] && /usr/local/bin/enable_drive4.sh
0 23 * * 6 /usr/local/bin/disable_drive4.sh
These cron lines:
- Add the drive early Saturday (2 AM)
- Remove the drive late Saturday (11 PM)
- Only run on the nth Saturday by checking if the date calculation overflows into the next month
Optional Hardening
To avoid backup errors when the excluded paths are removed:
- Ensure the UrBackup server does not predefine the paths
- Let the client fully control included dirs (
-x
= only client defines)
- Use:
urbackupclientctl list-backupdirs
to check what’s active
Summary
This gives you:
- Daily backups of their important drive (Drive1)
- Once-monthly staggered backups of large drives (Drives 2–4)
- No server-side complexity — just client cron logic
- Server doesn’t “see” the large drives except on their days