Skip to content

Instantly share code, notes, and snippets.

@eon01
Last active February 14, 2019 20:44
Show Gist options
  • Save eon01/e62c1ccdfbc144f8d1df004180aabb77 to your computer and use it in GitHub Desktop.
Save eon01/e62c1ccdfbc144f8d1df004180aabb77 to your computer and use it in GitHub Desktop.
This gist helps you to auto synchronize a local folder with an S3 bucket as soon as 1 or more files in the folder change. Helpful for live debugging when developping.
1) Install inotifywait
sudo apt install inotifywait
2) Use inotifywait to sync your folders to S3
s3folder = "<your_s3_fodler_path>"
s3bucket = "s3://<your_s3_bucket_name>"
while inotifywait $s3folder; do aws s3 sync $s3folder $s3bucket --delete; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment