s3.exe is a standalone windows command line utility available for managing s3 buckets and EC2 environments. this file don’t required any installation. To work with this script, we just need to have installed .Net framework 2.0 or above version. As much as I know, this script has limited options but it will be helpful for you for s3 bucket tasks and managing snapshots of EBS volumes.
Download s3.exe Utility
To Download s3.exe file visit s3.codeplex.com and download it. After downloading this file, you can put it under C:WindowsSystem32, so we can use it from any path in system.
Setup s3.exe Authentication
This utility provides option to save authentication for future, Get these security keys from aws securityCredentials page. It will prompt to login to your Amazon account.
C:> s3 auth [AWS ACCESS KEY] [AWS SECRET KEY]
How to Use s3.exe Utility
1. List all Buckets
Below command will list all the buckets in your s3 account.
s3 list
2. Upload File to Bucket
To update single or multiple files to s3 bucket
s3 put mybucket/backups/ c:backupfilesmyFile.bak s3 put mybucket/backups/ c:backupfiles*.bak
3. Upload Directory to Bucket
If you required, you can also upload entire directory to s3 bucket.
s3 put mybucket/backups/ c:backupfiles
4. Sync Directory to Bucket
While uploading entire directory, if same directory already exists on server use /sync to synchronize changes only.
s3 put mybucket/backups/ c:backupfiles /sync
5. Download File from Bucket
To download a single for multiple files from s3 bucket to local filesystem.
s3 get mybucket/*.bak s3 get mybucket/myFile.bak
6. Download Directory from Bucket
To download entire directory from s3 bucket. Below command will download backups directory form mybucket to local system present working directory. To know more about this command use “s3.exe help get”.
s3 get mybucket/backups/ /sub
1 Comment
Hey Rahual,
How can you upload a parent folder to S3 where the parent folder would have many child folders within.
IE – I want to upload Child1, which will have 20+ folders inside it.
Parent
-> Child1
-> 1 folder
->1.1Folder
-> data
->2 folder
->3 folder
etc
Kind Regards,
Alan.