Skip to content
A program which will recursively watch a directory for new files and upload them to S3
Go Dockerfile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cmd/go-watch-s3
internal/utils
.gitignore
Dockerfile
README.md
go.mod
go.sum

README.md

go-watch-s3

Watches a directory recursively for new files and uploads them to S3.

Configuration

Configuration is controlled by environment variables.

WATCH_PATH

Absolute path to directory to watch. Must include trailing slash. e.g. /absolute/path/to/files/

AWS_REGION

AWS region e.g. ap-southeast-2

AWS_S3_BUCKET

Name of S3 bucket files will be uploaded to e.g. mybucket.example.com

AWS_S3_KEY_PREFIX (Optional)

String to prepend to file names when constructing keys. Defaults to an empty string.

AWS_S3_STORAGE_CLASS (Optional)

S3 storage class used for storing objects. Can be STANDARD, STANDARD_IA or ONEZONE_IA. Defaults to STANDARD.

WATCH_INTERVAL (Optional)

Duration in milliseconds specifying how often the watch directory should be polled for new files. Defaults to 500.

PATH_PATTERN (Optional)

A regular expression used to filter paths. For example "mp4$" would only upload files ending with "mp4". Defaults to an empty string.

Docker

Build Docker image by running the following from the repository root.

docker build -t willdady/go-watch-s3:latest .
You can’t perform that action at this time.