Docs / Backup & Recovery / Automated Backup Notifications with Email Alerts

Automated Backup Notifications with Email Alerts

By Admin · Feb 24, 2026 · Updated Apr 25, 2026 · 5 views · 4 min read

This guide covers how to set up and configure notifications on a Linux VPS. Whether you're running a production environment or a development setup, these instructions will help you get started quickly and securely.

Backup Configuration

When scaling this setup, consider vertical scaling (adding more RAM/CPU) first, as it's simpler to implement. Horizontal scaling adds complexity but may be necessary for high-traffic applications.


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

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

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

The output should show the service running without errors. If you see any warning messages, address them before proceeding to the next step.

Scheduling Automated Backups

If you encounter issues during setup, check the system logs first. Most problems can be diagnosed by examining the output of journalctl or the application-specific log files in /var/log/.


# 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
notifications backup --repo $BACKUP_REPO /etc /home /var/www /tmp/db-$DATE.sql.gz

# Cleanup old backups (keep 30 days)
notifications 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

These commands should be run as root or with sudo privileges. If you're using a non-root user, prefix each command with sudo.

Security Implications

The notifications configuration requires careful attention to resource limits and security settings. On a VPS with limited resources, it's important to tune these parameters according to your available RAM and CPU cores.

Encryption and Security

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.


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

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

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

These commands should be run as root or with sudo privileges. If you're using a non-root user, prefix each command with sudo.

Advanced Settings

The default configuration works well for development environments, but production servers require additional tuning. Pay particular attention to connection limits, timeout values, and logging settings.

  • Use version control for configuration files
  • Set up monitoring before going to production
  • Test disaster recovery procedures regularly
  • Maintain runbooks for common operations

Testing Restore Procedures

Before making changes to the configuration, always create a backup of the existing files. This ensures you can quickly roll back if something goes wrong during the setup process.


# 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
notifications backup --repo $BACKUP_REPO /etc /home /var/www /tmp/db-$DATE.sql.gz

# Cleanup old backups (keep 30 days)
notifications 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.

Security Implications

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.

Summary

You've successfully configured notifications on your VPS. Remember to monitor performance, keep your software updated, and maintain regular backups. If you run into issues, consult the official documentation or open a support ticket for assistance.

Was this article helpful?