Docs / Backup & Recovery / Incremental Backups with Rsnapshot

Incremental Backups with Rsnapshot

By Admin · Feb 15, 2026 · Updated Apr 25, 2026 · 7 views · 4 min read

In this article, we'll walk through the complete process of working with rsnapshot in a server environment. Understanding incremental is essential for maintaining a reliable and performant infrastructure.

Prerequisites

  • Sufficient storage for backups (2-3x data size)
  • Root or sudo access to the server
  • A VPS running Ubuntu 22.04 or later (2GB+ RAM recommended)
  • A remote storage destination (S3, B2, or another server)
  • A registered domain name (for public-facing services)

Backup Configuration

Performance benchmarks show that properly tuned rsnapshot can handle significantly more concurrent connections than the default configuration. The key improvements come from adjusting worker processes and connection pooling.


# Install and initialize backup tool
sudo apt install -y rsnapshot
rsnapshot init --repo /backup/repo

# Create first backup
rsnapshot backup --repo /backup/repo /etc /home /var/www

# List backups
rsnapshot snapshots --repo /backup/repo

This configuration provides a good balance between performance and resource usage. For high-traffic scenarios, you may need to increase the limits further.

Important Notes

Performance benchmarks show that properly tuned rsnapshot can handle significantly more concurrent connections than the default configuration. The key improvements come from adjusting worker processes and connection pooling.

Scheduling Automated Backups

For production deployments, consider implementing high availability by running multiple instances behind a load balancer. This approach provides both redundancy and improved performance under heavy load.


# Automated backup script: /usr/local/bin/backup.sh
#!/bin/bash
set -euo pipefail

BACKUP_REPO="/backup/repo"
LOG_FILE="/var/log/backup.log"
DATE=$(date +%Y-%m-%d_%H-%M)

echo "[$DATE] Starting backup..." >> $LOG_FILE

# Database dump
mysqldump --all-databases | gzip > /tmp/db-$DATE.sql.gz

# Run backup
rsnapshot backup --repo $BACKUP_REPO /etc /home /var/www /tmp/db-$DATE.sql.gz

# Cleanup old backups (keep 30 days)
rsnapshot forget --repo $BACKUP_REPO --keep-daily 7 --keep-weekly 4 --keep-monthly 3 --prune

rm /tmp/db-$DATE.sql.gz
echo "[$DATE] Backup completed successfully" >> $LOG_FILE

Each line in the configuration serves a specific purpose. The comments explain the reasoning behind each setting, making it easier to customize for your specific use case.

Encryption and Security

Security should be a primary consideration when configuring rsnapshot. Always use strong passwords, keep software updated, and restrict network access to only the necessary ports and IP addresses.


# Install and initialize backup tool
sudo apt install -y rsnapshot
rsnapshot init --repo /backup/repo

# Create first backup
rsnapshot backup --repo /backup/repo /etc /home /var/www

# List backups
rsnapshot snapshots --repo /backup/repo

Each line in the configuration serves a specific purpose. The comments explain the reasoning behind each setting, making it easier to customize for your specific use case.

Testing Restore Procedures

It's recommended to test this configuration in a staging environment before deploying to production. This helps identify potential compatibility issues and allows you to benchmark performance differences.


# Automated backup script: /usr/local/bin/backup.sh
#!/bin/bash
set -euo pipefail

BACKUP_REPO="/backup/repo"
LOG_FILE="/var/log/backup.log"
DATE=$(date +%Y-%m-%d_%H-%M)

echo "[$DATE] Starting backup..." >> $LOG_FILE

# Database dump
mysqldump --all-databases | gzip > /tmp/db-$DATE.sql.gz

# Run backup
rsnapshot backup --repo $BACKUP_REPO /etc /home /var/www /tmp/db-$DATE.sql.gz

# Cleanup old backups (keep 30 days)
rsnapshot forget --repo $BACKUP_REPO --keep-daily 7 --keep-weekly 4 --keep-monthly 3 --prune

rm /tmp/db-$DATE.sql.gz
echo "[$DATE] Backup completed successfully" >> $LOG_FILE

Note that file paths may vary depending on your Linux distribution. The examples here are for Debian/Ubuntu; adjust paths accordingly for RHEL/CentOS-based systems.

Configuration Options

After applying these changes, monitor the server's resource usage for at least 24 hours to ensure stability. Tools like htop, iostat, and vmstat can provide real-time insights into system performance.

  • Scale vertically before scaling horizontally
  • Profile before optimizing - measure first
  • Start with the minimum required resources

Common Issues and Solutions

  • Permission denied errors: Ensure files and directories have the correct ownership. Use chown -R to fix ownership and chmod for permissions.
  • Connection timeout: Verify your firewall rules allow traffic on the required ports. Use ss -tlnp to confirm the service is listening on the expected port.
  • Service won't start: Check the logs with journalctl -xe -u rsnapshot. Common causes include port conflicts, missing configuration files, or insufficient permissions.

Next Steps

With rsnapshot now set up and running, consider implementing monitoring to track performance metrics over time. Regularly review your configuration as your workload changes and scale resources accordingly.

Was this article helpful?