I am trying to use rsync to sync my S3 bucket with my EC2 servers. However I am having trouble coming up with the code. On my EC2 server I have tried the following, but it doesn't work. I know my S3 address is wrong but I'm not sure what to put in its place. iosSourceCode is the bucket name. How can I sync the files in this bucket to my EC2 server's files? After I get this to work I was going to set up a cronjob to do this every 10 minutes or whatever. Is there a better way to do this and if so how? Please provide code, thanks!
sudo rsync -ra iosSourceCode.s3-website-us-east-1.amazonaws.com /var/www/