Back to Blog
team@tinypod.app

Backup Automation with Restic: Set It and Forget It

Restic is a fast, encrypted backup tool. Deduplicated, incremental backups to any storage — S3, B2, local, SFTP.

resticbackupsautomationstorage

What Is Restic?


Restic is a backup program that is fast, efficient, and secure. It produces encrypted, deduplicated backups that can be stored anywhere.


Key Features


Encryption

Every backup is encrypted with AES-256. Even if someone accesses your backup storage, they can't read your data.


Deduplication

Restic only stores data that changed since the last backup. If you have 100 GB of data and 1 GB changed, the backup stores ~1 GB, not 100 GB.


Multiple Backends

  • Local filesystem
  • SFTP (any SSH server)
  • Amazon S3
  • Backblaze B2
  • Google Cloud Storage
  • Azure Blob Storage
  • Minio (self-hosted S3)
  • REST server

  • Snapshots

    Each backup creates a snapshot. Browse and restore individual files from any point in time.


    Setup


    Initialize Repository

    restic -r s3:s3.amazonaws.com/my-backups init


    Create Backup

    restic -r s3:s3.amazonaws.com/my-backups backup /data


    List Snapshots

    restic -r s3:s3.amazonaws.com/my-backups snapshots


    Restore

    restic -r s3:s3.amazonaws.com/my-backups restore latest --target /restore


    Automation


    Cron Job

    Run backups daily at 2 AM:

    0 2 * * * restic -r s3:... backup /data --password-file /etc/restic-password


    Retention Policy

    Keep 7 daily, 4 weekly, 12 monthly, and 2 yearly snapshots:

    restic forget --keep-daily 7 --keep-weekly 4 --keep-monthly 12 --keep-yearly 2 --prune


    Monitoring

    Pipe output to a monitoring system. If the backup fails, get alerted.


    What to Back Up


    For Self-Hosted Apps

  • Database dumps (run pg_dump/mysqldump before Restic)
  • Application data directories
  • Configuration files
  • SSL certificates (though Caddy regenerates these)
  • Environment variable files

  • Exclude

  • Container images (pull from registry)
  • Log files (unless required for compliance)
  • Cache directories
  • Temporary files

  • Cost


    Backblaze B2: $0.005/GB/month

    100 GB of backups: $0.50/month

    1 TB of backups: $5/month


    With deduplication, 1 TB of data might only use 200 GB of backup storage.


    TinyPod includes automated backups. For additional backup destinations, Restic integrates seamlessly with your TinyPod server.