Giter Site home page Giter Site logo

travelton / docker-aws-s3-sync Goto Github PK

View Code? Open in Web Editor NEW

This project forked from futurevision/docker-aws-s3-sync

0.0 1.0 0.0 9 KB

Docker container to sync two buckets on Amazon S3

License: MIT License

Dockerfile 41.71% Shell 58.29%
aws-s3 sync docker

docker-aws-s3-sync's Introduction

travelton/aws-s3-sync

Docker container that periodically syncs one S3 bucket to another S3 bucket using the AWS Command Line Interface tool and cron.

Usage

docker run -d [OPTIONS] travelton/aws-s3-sync

Required Parameters:

  • -e KEY=<KEY>: User Access Key
  • -e SECRET=<SECRET>: User Access Secret
  • -e REGION=<REGION>: Region of your bucket
  • -e DESTINATION_BUCKET=<DESTINATION_BUCKET>: The name of your source bucket
  • -e SOURCE_BUCKET=<SOURCE_BUCKET>: The name of your destination bucket

Optional parameters:

  • -e SOURCE_BUCKET_PATH=<SOURCE_BUCKET_PATH>: The path of your s3 bucket where the files should be synced FROM (must start with a slash), defaults to "/" to sync to bucket root
  • -e DESTINATION_BUCKET_PATH=<DESTINATION_BUCKET_PATH>: The path of your s3 bucket where the files should be synced TO (must start with a slash), defaults to "/" to sync to bucket root
  • -e PARAMS=: parameters to pass to the sync command (full list here).
  • -e MAX_CONCURRENT_REQUESTS=10: number of concurrent requests to process 10-200.
  • -e CRON_SCHEDULE="0 1 * * *": specifies when cron job starts (details), defaults to 0 1 * * * (runs every night at 1:00).
  • now: run container once and exit (no cron scheduling).

Examples:

Sync every hour via cron (container continues to run):

docker run -d \
	-e KEY=mykey \
	-e SECRET=mysecret \
	-e REGION=region \
	-e SOURCE_BUCKET=mybucket \
	-e DESTINATION_BUCKET=mybucket \
	-e SOURCE_BUCKET_PATH=/path \
	-e DESTINATION_BUCKET_PATH=/path \
	-e CRON_SCHEDULE="0 * * * *" \
	travelton/aws-s3-sync

Sync just once (container is stopped):

docker run --rm \
	-e KEY=mykey \
	-e SECRET=mysecret \
	-e REGION=region \
	-e SOURCE_BUCKET=mybucket \
	-e DESTINATION_BUCKET=mybucket \
	travelton/aws-s3-sync now

Credits

This container was forked and tweaked to sync two buckets, rather than a local source, https://github.com/futurevision/docker-aws-s3-sync.

docker-aws-s3-sync's People

Contributors

futurevision avatar levibostian avatar slootjes avatar travelton avatar

Watchers

 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.