Skip to content

Instantly share code, notes, and snippets.

@arvindkumarbadwal
Created May 12, 2020 09:45
Show Gist options
  • Save arvindkumarbadwal/29dd47d85f918a89a97ba7273884ec3a to your computer and use it in GitHub Desktop.
Save arvindkumarbadwal/29dd47d85f918a89a97ba7273884ec3a to your computer and use it in GitHub Desktop.
Syncing files from EC2 instance to S3 bucket
#!/bin/bash
#source directory path
backup_path=/var/www/application/uploads
#destination s3 bucketname
bucket_name=uploads
echo "Sync Process Start ::" $(date)
# s3 sync command
aws s3 sync $backup_path s3://$bucket_name
echo "Sync Process End ::" $(date)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment