S3 backup
Alpine image that archives a directory on a cron schedule and syncs the archives to an S3 bucket with rclone. It works with S3-compatible providers such as AWS, DigitalOcean, Google Cloud and Backblaze.
registry.gitlab.com/hosstio/docker-images/s3-backup/master:latestSource: hosstio/docker-images/s3-backup
Features
- Compresses files into a
.tar.gzarchive - Copies backup archives to an S3 bucket
- Runs backups on a cron schedule
- Keeps only the latest N local archives
- Sends a webhook after a successful backup
Configuration
S3
| Variable | Description |
|---|---|
S3_ACCESS_KEY_ID | Access key |
S3_SECRET_KEY | Secret key |
S3_BUCKET_NAME | Bucket name |
S3_BUCKET_PATH | Path in the bucket |
S3_REGION | Region |
S3_ENDPOINT | Endpoint |
S3_DEBUG | Debug output for the sync, default false |
S3_SYNC_DELETE | Delete files in the bucket that don't exist locally, default false |
Backup
| Variable | Description |
|---|---|
BACKUP_PATH | Directory to back up, default /data |
BACKUP_NAME | Prefix of the archive file name, default backup |
BACKUP_SCHEDULE | Cron schedule, for example 0 3 * * * for daily at 03:00; without it no backup runs |
BACKUP_ARCHIVE | Create an archive of BACKUP_PATH, default true |
BACKUP_ARCHIVE_FILE | Archive file, default ${BACKUP_ARCHIVE_PATH}${BACKUP_NAME}-$(date "+%Y-%m-%d_%H%M").tar.gz |
BACKUP_ARCHIVE_PATH | Directory for the archives, default /tmp/backups/ |
BACKUP_ARCHIVE_RETENTION | Number of local archives to keep, default unlimited |
Webhook
| Variable | Description |
|---|---|
WEBHOOK_URL | URL that gets a POST after a successful backup |
WEBHOOK_MESSAGE | Value of status in the webhook's JSON body, default Backup completed successfully |