Backups & Snapshots
VPS Snapshots and Backup Strategies
Protect your data with VPS snapshots, automated rsync backups, and a recovery strategy.
Published Apr 20, 2025Updated Apr 20, 20268 min readBeginner
Table of Contents
Snapshots vs Backups — What's the Difference?
| Snapshot | Backup | |
|---|---|---|
| Speed | Instant | Minutes to hours |
| Location | Same physical hardware | Different server/location |
| Protection | Software failures, bad changes | Hardware failure, datacenter fire |
| Retention | Limited (plan-dependent) | Unlimited if off-site |
⚠️ Snapshots are NOT a substitute for off-site backups. If your physical host fails, both your VPS and its snapshots could be lost.
Creating Snapshots in VirtFusion
- Log in to your VirtFusion control panel
- Select your VPS
- Click the Snapshots tab
- Click Create Snapshot
- Name it descriptively: before-nginx-upgrade-2026-06-15
Snapshot creation takes 1–5 minutes. Your server stays online during this process.
Restoring a Snapshot
In the Snapshots tab, click Restore next to the snapshot you want. Your server reboots and all data reverts to the snapshot state.
⚠️ Restore is destructive — all changes since the snapshot was taken will be lost. Always verify you've selected the right snapshot.
Off-Site Backup with rsync
First, set up SSH key authentication to your backup server (see SSH Key Authentication). Then:
#!/bin/bash
# /opt/backup.sh
REMOTE_USER="backup"
REMOTE_HOST="backup-server.example.com"
REMOTE_PATH="/backups/$(hostname)"
DATE=$(date +%Y-%m-%d)
# Sync /var/www to remote server
rsync -avz --delete --exclude='*.tmp' --exclude='node_modules' /var/www/ "$REMOTE_USER@$REMOTE_HOST:$REMOTE_PATH/www/"
# Backup all MySQL databases
mysqldump --all-databases -u root -p"$DB_PASS" | gzip > /tmp/all_dbs_$DATE.sql.gz
rsync -avz /tmp/all_dbs_$DATE.sql.gz "$REMOTE_USER@$REMOTE_HOST:$REMOTE_PATH/mysql/"
echo "Backup completed: $DATE"
chmod +x /opt/backup.sh
# Run daily at 3 AM
(crontab -l; echo "0 3 * * * /opt/backup.sh >> /var/log/backup.log 2>&1") | crontab -snapshotbackuprestoreVPSrsync
Was this article helpful?
