Coder Social home page Coder Social logo

jameswrc / docker-backup-to-s3 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sjafferali/docker-backup-to-s3

0.0 0.0 0.0 19 KB

Docker container that periodically backups files to Amazon S3 using s3cmd and cron for ARM 64

Home Page: https://hub.docker.com/r/istepanov/backup-to-s3/

License: MIT License

Shell 81.45% Dockerfile 18.55%

docker-backup-to-s3's Introduction

originally from 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] jameswrc/docker-backup-to-s3

Used for ARM64.

Parameters:

  • -e ACCESS_KEY=<AWS_KEY>: Your AWS key.
  • -e SECRET_KEY=<AWS_SECRET>: Your AWS secret.
  • -e S3_PATH=s3://<BUCKET_NAME>/<PATH>/: S3 Bucket name and path. Should end with trailing slash.
  • -v /path/to/backup:/data:ro: mount target local folder to container's data folder. Content of this folder will be synced with S3 bucket.

Optional parameters:

  • -e ZIP_NAME='db_backup.zip': Specify zip file name to zip path and upload single zip files. If not specified, will upload raw directory path.
  • -e PARAMS="--dry-run": parameters to pass to the sync command (full list here).
  • -e DATA_PATH=/data/: container's data folder. Default is /data/. Should end with trailing slash.
  • -e 'CRON_SCHEDULE=0 1 * * *': specifies when cron job starts (details). Default is 0 1 * * * (runs every day at 1:00 am).
  • no-cron: run container once and exit (no cron scheduling).

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.

docker-backup-to-s3's People

Contributors

istepanov avatar pve avatar sjafferali avatar jameswrc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.