HUB
Sign inSign up

caseycs/dir-backup-s3

By caseycs

•Updated almost 9 years ago

Docker image to backup directory to S3

Image
0

8.7K

caseycs/dir-backup-s3 repository overview

⁠dir-backup-s3

Docker image to backup directory to S3 via s3cmd⁠

⁠Motivation

Useful to backup host machine directory or docker volume.

You can run it via crontab or even jenkins (with build periodically).

⁠Usage example

For Amazon S3:

docker run --rm \
  -v $(pwd):/backup
  -e NAME=backup-name \
  -e AWS_ACCESS_KEY=xxx \
  -e AWS_SECRET_KEY=xxx \
  -e S3_PATH=bucket/directory \
  caseycs/dir-backup-s3

For DigitalOcean Spaces:

docker run --rm \
  -v $(pwd):/backup
  -e NAME=backup-name \
  -e AWS_ACCESS_KEY=xxx \
  -e AWS_SECRET_KEY=xxx \
  -e S3_PATH=bucket/directory \
  -e S3CMD_OPTIONS="--host=ams3.digitaloceanspaces.com --host-bucket=%(bucket)s.ams3.digitaloceanspaces.com" \
  caseycs/dir-backup-s3

⁠Compression options

You can specify compressor via COMPRESSOR variable, J (xz) is used by default:

z	(De)compress using gzip
J	(De)compress using xz
j	(De)compress using bzip2
a	(De)compress using lzma

You can define gzip compression options via environment variable, for example: -e GZIP=-9

Tag summary
Recent tags
Content type
Image
Digest
Size
16.9 MB
Last updated
almost 9 years ago
docker pull caseycs/dir-backup-s3:latest