Home

Awesome

istepanov/backup-to-s3

Docker Stars Docker Pulls Docker Build Layers

Docker container that periodically backups files to Amazon S3 using s3cmd sync and cron.

Usage

docker run -d [OPTIONS] istepanov/backup-to-s3

Parameters:

Optional parameters:

Examples:

Run upload to S3 everyday at 12:00pm:

docker run -d \
    -e ACCESS_KEY=myawskey \
    -e SECRET_KEY=myawssecret \
    -e S3_PATH=s3://my-bucket/backup/ \
    -e 'CRON_SCHEDULE=0 12 * * *' \
    -v /home/user/data:/data:ro \
    istepanov/backup-to-s3

Run once then delete the container:

docker run --rm \
    -e ACCESS_KEY=myawskey \
    -e SECRET_KEY=myawssecret \
    -e S3_PATH=s3://my-bucket/backup/ \
    -v /home/user/data:/data:ro \
    istepanov/backup-to-s3 no-cron

Run once to get from S3 then delete the container:

docker run --rm \
    -e ACCESS_KEY=myawskey \
    -e SECRET_KEY=myawssecret \
    -e S3_PATH=s3://my-bucket/backup/ \
    -v /home/user/data:/data:rw \
    istepanov/backup-to-s3 get

Run once to delete from s3 then delete the container:

docker run --rm \
    -e ACCESS_KEY=myawskey \
    -e SECRET_KEY=myawssecret \
    -e S3_PATH=s3://my-bucket/backup/ \
    istepanov/backup-to-s3 delete

Security considerations: on restore, this opens up permissions on the restored files widely.