You probably know Amazon Simple Storage Service (Amazon S3). If not, it is an online storage web service offered by Amazon, providing unlimited storage. The price is very reasonable (0.15 US-$ per gigabyte and per month). They only disadvantage is that it is very difficult to use and to access – if you do not use any tools for doing so!
Under Linux I found that s3cmd suits best to my needs. It is very simple to use. If you call it the first time, you have to enter your key and secret key, and that’s all.
Now, if you call it again with the parameter “ls”, you can list the contents of your web service:
jomep@jcld1:~$ s3cmd ls
2009-07-17 21:32 s3://jets3t-53c2d2df01beff6cd244edbd8005c658
2009-07-10 23:07 s3://jomep-test
2008-11-09 12:52 s3://jomep77-backups
2009-07-24 23:57 s3://jomep77-jcld1-svn-backup
2009-07-17 21:48 s3://jomep77-photos
2009-07-10 23:07 s3://jomep77-test
jomep@jcld1:~$ s3cmd ls
2008-11-09 12:52 s3://jomep-7H3LpA11-backups
2009-07-24 23:57 s3://jomep-7H3LpA11-jcld1-svn-backup
2009-07-17 21:48 s3://jomep-7H3LpA11-photos
2009-07-10 23:07 s3://jomep-7H3LpA11-test
To determine the size of a bucket in bytes simply call:
jomep@jcld1:~$ s3cmd du s3://jomep-7H3LpA11-jcld1-svn-backup
3523030246 s3://jomep-7H3LpA11-jcld1-svn-backup/
Or, to get the size in human readable format:
jomep@jcld1:~$ s3cmd du s3://jomep-7H3LpA11-jcld1-svn-backup -H
3G s3://jomep-7H3LpA11-jcld1-svn-backup/
The best usage is however the sync parameter. This is what I use, to make daily backups of my data:
s3cmd sync /srv/svn s3://jomep-7H3LpA11-jcld1-svn-backup/
If you use parameter “–delete-removed”, all files that exist on the destination but not (anymore) on the source are deleted.
I use Debian GNU/Linux and installed s3cmd by simply installing the package with the same name:
aptitude install s3cmd
The following commands are listed in the man page:
Commands:
Make bucket
s3cmd mb s3://BUCKET
Remove bucket
s3cmd rb s3://BUCKET
List objects or buckets
s3cmd ls [s3://BUCKET[/PREFIX]]
List all object in all buckets
s3cmd la
Put file into bucket
s3cmd put FILE [FILE...] s3://BUCKET[/PREFIX]
Get file from bucket
s3cmd get s3://BUCKET/OBJECT LOCAL_FILE
Delete file from bucket
s3cmd del s3://BUCKET/OBJECT
Synchronize a directory tree to S3
s3cmd sync LOCAL_DIR s3://BUCKET[/PREFIX] or s3://BUCKET[/PREFIX] LOCAL_DIR
Disk usage by buckets
s3cmd du [s3://BUCKET[/PREFIX]]
Get various information about Buckets or Objects
s3cmd info s3://BUCKET[/OBJECT]
For further information have a look on the amazon website at http://aws.amazon.com/s3/ or at the wikipedia article on http://en.wikipedia.org/wiki/Amazon_S3.
I found a good article about s3cmd here: http://s3tools.org/s3cmd.