0

Is there a way to keep a local folder mounted to s3 so that any time files are added to the folder, they are automatically added to s3 without needing human interaction?

I've seen

aws s3 sync ./mylocalfolder  s3://my-bucket

But this only runs once and exits.

Is there a way to keep the connection established?

slashdottir
  • 7,835
  • 7
  • 55
  • 71

1 Answers1

1

You could put a watch on the directory that you want to watch and trigger the sync that way.

There isn't an out of the box cli command that will keep s3 sync open.

fswatch -o ~/path/to/watch | xargs -n1 -I{} ~/myAwsS3SyncScript.sh

Here is a good post on fswatch

Brian McCall
  • 1,831
  • 1
  • 18
  • 33