How to sync files between the workstation and EC2 without having to log the EC2 in manually every time

amazon ec2amazon-web-servicessynchronization

I want to do something that seems dead simple, but none of the options I've found are quite right (e.g. Dropbox).

The question is: what cloud sync service can I use to sync a folder on my workstation with the filesystem in an EC2 instance? Note these requirements:

  • It must have a unattended/scriptable installation and configuration that happens on init of the EC2 (since EC2 instances are ephemeral)
  • And thus it may only depend on EC2 environment variables for any service installation credentials
  • The service on EC2 needs read-only, recursive synchronization (not plain downloading; there are too many files to simply download a directory archive and expand it periodically).
  • Both workstation and EC2 are syncing with a shared source cloud repository like Dropbox, since that workstation is not always on/publicly accessible
  • The app on my EC2 instance is nodeJS, for what it's worth!

The Dropbox Linux client, for example, (or nodejS libraries I've found) require attended installation, to visit a Dropbox URL every time the instance needs to log its Dropbox client in. Same is true for Bittorrent sync, requiring visiting a localhost URL to link with devices.

Even if another tiny EC2 instance is to sync Dropbox for example with Elastic File System. It might be longer-lived, but is still ephemeral and needs an unattended init-script installation.

Thanks in advance.

Best Answer

Look about rsync. It can sync data across any platform and can use ssh for log in and transfer encrypting. And you're not using any 3rd party service.

Related Topic