A solid backup strategy is your last line of defense against data loss from hardware failures, accidental deletion, ransomware, software bugs, and misconfigured updates. This guide helps you plan and implement a comprehensive backup approach for your Data Mammoth servers.
The 3-2-1 Backup Rule
Follow the industry-standard 3-2-1 rule:
- 3 copies of your data (original + 2 backups)
- 2 different media types (e.g., server disk + external backup storage)
- 1 offsite copy (stored in a different physical location)
Backup Types
Server Snapshots
Snapshots capture the complete state of your server at a point in time — including the OS, applications, configurations, and data.
Advantages:
- Full system restore in minutes.
- Easy to create and manage through the dashboard.
- Ideal for pre-change backups (before updates, upgrades, or major configuration changes).
Automated Backups
Data Mammoth offers automated backup add-ons that create regular snapshots on a schedule:
- Daily backups — A snapshot every 24 hours.
- Weekly backups — A snapshot every 7 days.
- Retention policy — A set number of backups are kept, with older ones automatically rotated.
Application-Level Backups
Back up specific applications and databases for granular recovery:
Database backups:
# MySQL/MariaDB
mysqldump -u root -p --all-databases > /backup/all_databases_$(date +%Y%m%d).sqlPostgreSQL
pg_dumpall -U postgres > /backup/all_databases_$(date +%Y%m%d).sqlFile backups:
# Compress website files
tar -czf /backup/www_$(date +%Y%m%d).tar.gz /var/www/Compress configuration files
tar -czf /backup/etc_$(date +%Y%m%d).tar.gz /etc/Offsite Backups
Store copies of your backups in a separate location:
- Object storage — Upload backups to cloud storage services.
- Remote server — Transfer backups to another Data Mammoth server in a different region.
- Local download — Download backups to your local machine or office storage.
rsync -avz /backup/ [email protected]:/offsite-backup/Automating Backups with Cron
Create a backup script:
sudo nano /usr/local/bin/backup.sh#!/bin/bash DATE=$(date +%Y%m%d_%H%M%S) BACKUP_DIR="/backup"Create backup directory
mkdir -p $BACKUP_DIRDatabase backup
mysqldump -u root --all-databases | gzip > $BACKUP_DIR/db_$DATE.sql.gzFile backup
tar -czf $BACKUP_DIR/www_$DATE.tar.gz /var/www/Remove backups older than 30 days
find $BACKUP_DIR -name "*.gz" -mtime +30 -deleteOptional: sync to remote
rsync -avz $BACKUP_DIR/ [email protected]:/offsite-backup/
echo "Backup completed: $DATE"
Make it executable and schedule it:
chmod +x /usr/local/bin/backup.sh
sudo crontab -eAdd a daily backup at 3:00 AM:
0 3 * /usr/local/bin/backup.sh >> /var/log/backup.log 2>&1Backup Schedule Recommendations
| Data Type | Frequency | Retention |
|---|---|---|
| Full server snapshot | Weekly | 4 snapshots (1 month) |
| Database | Daily | 30 days |
| Application files | Daily | 14 days |
| Configuration files | After every change | 90 days |
| Offsite copy | Weekly | 12 copies (3 months) |
Testing Your Backups
Backups are worthless if they cannot be restored. Test regularly:
Test at least quarterly, or more frequently for critical systems.
What to Do Next
- Managing Server Add-ons — Enable automated backups.
- Complete Server Security Checklist — Full security review including backups.
- Security at Data Mammoth — Our security approach.
- How to Submit a Support Ticket — Get help with backup setup.