-
-
Notifications
You must be signed in to change notification settings - Fork 4
Backup Plans
A backup plan defines what to back up, where to store it, when to run backups, and how long to keep them. Each plan belongs to a specific client and targets one repository.
A backup plan consists of:
- Source paths: Directories and files to back up
- Exclusions: Patterns for files/directories to skip
- Repository: Where to store the backup archives
- Schedule: When to run backups automatically
- Retention policy: How many backups to keep and for how long
- Plugins: Optional pre/post backup hooks (database dumps, S3 sync, etc.)
To create a new backup plan:
- Navigate to the client detail page
- Click the Schedules tab
- Click Create New Plan
- Configure the plan settings (see below)
- Click Save Plan
Screenshot: Backup plan creation form showing all configuration options
A descriptive name for the plan (e.g., "Daily System Backup", "Hourly Database Snapshots", "Weekly Full Backup").
Select the target repository from the dropdown. The list shows only repositories that belong to the current client.
If you haven't created a repository yet, see Repositories for instructions.
Specify the paths to back up. You can enter paths in two formats:
One path per line:
/etc
/var/www
/home
Space-separated on a single line:
/etc /var/www /home
Tips:
- Use absolute paths (starting with
/) - Include parent directories rather than many individual files (more efficient)
- Consider using backup templates (see below) for common directory sets
Specify files and directories to exclude from the backup using borg patterns. Common patterns:
Exclude specific directories:
*/node_modules
*/__pycache__
*/.cache
*/tmp
Exclude by extension:
*.log
*.tmp
*.swp
*.pyc
Exclude hidden files:
.*
Exclude system directories:
/proc
/sys
/dev
/run
/tmp
Pattern syntax:
-
*matches anything except/ -
**matches anything including/ -
?matches any single character -
[abc]matches any character in the set - Patterns are matched against the full path
For more information, see the BorgBackup patterns documentation.
BBS supports all borg compression specs. The compression field accepts a free-text value with autocomplete suggestions for common options:
| Spec | Description |
|---|---|
lz4 |
Very fast, low compression (default) |
zstd |
Balanced speed and compression (default level 3) |
zstd,N |
Zstandard with level 1-22 (e.g., zstd,10 for higher compression) |
zlib |
Medium speed, medium compression (default level 6) |
zlib,N |
Zlib with level 0-9 |
lzma |
Slow, high compression (default level 6) |
lzma,N |
LZMA with level 0-9 (e.g., lzma,6 for ~4x space reduction over lz4) |
auto,C,L |
Auto-detect: only compress compressible data (e.g., auto,lzma,6) |
obfuscate,S,C |
Add size obfuscation with encryption (e.g., obfuscate,110,none) |
none |
No compression |
Click the Help link next to the compression field for the full borg compression documentation.
Tips:
-
lz4is a good default — fast with minimal CPU impact -
zstdorzstd,3offers a good balance for most workloads -
lzma,6gives the best compression ratio but is significantly slower -
auto,*modes skip compression for already-compressed data (images, videos, archives), saving CPU time
Choose when backups should run automatically:
- No automatic scheduling
- Backups run only when triggered manually via "Run Now" button
- Useful for on-demand backups or testing
- Runs at specified minutes past each hour
- Options: 0, 15, 30, or 45 minutes past the hour
- Example: "15" runs at 00:15, 01:15, 02:15, etc.
- Runs once per day at a specified time
- Enter time in 24-hour format (e.g., "03:00" for 3 AM)
- Best for most production backups
- Runs once per week on a specified day and time
- Choose day: Monday through Sunday
- Enter time in 24-hour format
- Good for full system backups
- Runs once per month on a specified day and time
- Choose day: 1-28 (days 29-31 are avoided to ensure the backup runs every month)
- Enter time in 24-hour format
- Useful for long-term archive snapshots
Note: All times are in the server's timezone. Scheduled jobs are queued by the BBS scheduler (cron-driven), and the agent picks them up on its next poll cycle.
The retention policy determines how long backups are kept using borg's prune command. BBS supports these retention options:
- Keep last N minutes: Number of minutely archives to keep (default: 0)
- Keep last N hours: Number of hourly archives to keep (default: 0)
- Keep last N days: Number of daily archives to keep (default: 7)
- Keep last N weeks: Number of weekly archives to keep (default: 4)
- Keep last N months: Number of monthly archives to keep (default: 6)
- Keep last N years: Number of yearly archives to keep (default: 0)
How retention works:
After each backup, borg automatically runs the prune command with your specified retention policy. Borg intelligently selects which archives to keep based on:
- The time interval (minute, hour, day, week, month, year)
- The number you specified for each interval
- The archive timestamps
Example retention policy:
Keep last 7 days: 7
Keep last 4 weeks: 4
Keep last 6 months: 6
This keeps:
- 7 most recent daily backups
- 4 weekly backups (one per week for the last 4 weeks)
- 6 monthly backups (one per month for the last 6 months)
Older archives are automatically deleted during the prune operation.
Best Practices:
- Match retention to your recovery time objectives (RTO) and recovery point objectives (RPO)
- Consider regulatory requirements for data retention
- Balance storage costs against the need for long-term recovery points
- For critical data, keep at least 7 days, 4 weeks, and 6 months
- For databases with frequent changes, consider hourly retention
Optionally attach plugins to extend backup functionality:
Automatically dumps MySQL/MariaDB databases before the backup runs:
- Select databases to dump (or dump all)
- Dumps are stored in
/tmp/bbs-mysql-dump/and included in the backup - Dumps are automatically cleaned up after backup completes
Automatically dumps PostgreSQL databases before the backup runs:
- Select databases to dump (or dump all)
- Dumps are stored in
/tmp/bbs-pg-dump/and included in the backup - Dumps are automatically cleaned up after backup completes
Run custom scripts before or after backups:
- Pre-backup script: Runs before borg create (e.g., stop services, flush caches)
- Post-backup script: Runs after borg create (e.g., restart services, send notifications)
- Scripts run as root on the client machine
Automatically sync the repository to Amazon S3 or compatible storage after backup completes:
- Requires AWS credentials or compatible S3 service
- Provides off-site backup redundancy
- Runs asynchronously (backup completes before sync)
Send email alerts on backup success or failure:
- Configure recipient addresses
- Choose notification triggers (failure only, or success and failure)
Ping external monitoring services (e.g., healthchecks.io) after successful backups:
- Provides external monitoring and alerting
- Helps ensure backups are running even if BBS has issues
Using Plugin Configurations:
Plugins use reusable configurations. For example, you can create a "Production MySQL" configuration once and attach it to multiple backup plans. To create a plugin configuration:
- Go to Settings → Plugin Configurations
- Click Add Configuration
- Choose the plugin type
- Enter configuration details
- Save with a descriptive name
Then, when creating a backup plan, you can select this saved configuration from the dropdown.
Administrators can create reusable directory and exclusion templates in Settings → Backup Templates. Templates provide pre-configured sets of paths and exclusions for common scenarios:
-
Web Server:
/var/www,/etc/apache2,/etc/nginx, with exclusions for logs and caches -
Database Server:
/var/lib/mysql,/etc/mysql, with exclusions for temp files -
User Home Directories:
/home, with exclusions for caches and temporary files
To use a template when creating a backup plan:
- Click Load Template on the plan creation form
- Select a template from the dropdown
- The directories and exclusions fields are populated automatically
- Customize as needed
To edit an existing backup plan:
- Navigate to the client detail page → Schedules tab
- Click Edit next to the plan
- Modify any settings
- Click Save Changes
Changes to the schedule frequency or retention policy take effect immediately. The next scheduled backup will use the updated configuration.
You can temporarily disable a backup plan's schedule without deleting the plan:
- Navigate to the client detail page → Schedules tab
- Click the toggle switch next to the plan name
- When disabled, automatic backups will not run, but you can still trigger manual backups
This is useful for:
- Temporarily pausing backups during maintenance
- Testing configuration changes without affecting the schedule
- Disabling backups for decommissioned systems without losing the configuration
To trigger an immediate backup regardless of the schedule:
- Navigate to the client detail page → Schedules tab
- Click Run Now next to the plan
- The backup is queued immediately
- The agent picks up the job on its next poll cycle (typically within 30 seconds)
Manual backups follow the same configuration as scheduled backups (same directories, exclusions, retention policy, etc.).
When a backup job runs, the following sequence occurs:
- BBS creates a backup job in the
backup_jobstable with statusqueued - The job includes all plan settings (directories, exclusions, retention, etc.)
- On the agent's next poll cycle, BBS returns the job with status
sent - Agent acknowledges receipt and marks the job as
running
- If configured, the agent runs pre-backup plugins:
- Database dumps (MySQL/PostgreSQL)
- Pre-backup shell hooks
- Any errors in plugins cause the backup to fail immediately
- Agent executes
borg createwith the configured directories and exclusions - Borg reads all specified files, deduplicates data, compresses, encrypts, and transfers to the repository
- Progress updates are sent to BBS every 10 seconds
- Archive name format:
{hostname}-{timestamp}(e.g.,webserver-2026-02-02T03:00:00)
- Agent executes
borg prunewith the configured retention policy - Old archives beyond the retention limits are marked for deletion
- Repository space is not reclaimed yet (happens during compact)
- Agent executes
borg compactto reclaim space from deleted archives - This step can be skipped for faster backups if space reclamation isn't urgent
- If configured, the agent runs post-backup plugins:
- S3 sync (asynchronous, doesn't block job completion)
- Post-backup shell hooks
- Health check pings
- Email notifications
- Agent marks the job as
completed(orfailedif errors occurred) - Job statistics are recorded (duration, bytes transferred, files processed, etc.)
- The client's "Last Backup" timestamp is updated
- Temporary files (database dumps, etc.) are removed
- SSH connections are closed
- The agent returns to polling for new tasks
Typical Duration:
Backup duration depends on:
- Amount of data to back up
- Change rate since last backup (incremental)
- Network speed (if repository is remote)
- CPU performance (compression/encryption)
- Disk I/O speed
First backup (full): Several minutes to hours Subsequent backups (incremental): Seconds to minutes
Next: Restoring-Files | Repositories
📖 User Manual
Getting Started
Using BBS
- Dashboard
- Managing Clients
- Linux Agent Setup
- macOS Agent Setup
- Windows Agent Setup
- Repositories
- Storage Setup
- Backup Plans
- Restoring Files
- Database Backups
- Plugins
- Remote Storage
- S3 Offsite Sync
Monitoring
Administration
Reference