s3cmd : command line S3 client

Amazon S3 is a reasonably priced data storage service. Ideal for off-site backups, archiving and other data storage needs. It is generally more reliable than your regular web hosting for storing your files and images. Check out About Amazon S3 section to find out more.

S3cmd is a command line tool for uploading, retrieving and managing data in Amazon S3. It is best suited for power users who don't fear command line. It is also ideal for scripts, automated backups triggered from cron, etc.

S3cmd is an open source project available under GNU Public License v2 (GPLv2) and is free for both commercial and private use. You will only have to pay Amazon for using their storage. None of these money go to S3cmd developers.

Unless, of course, you decide to donate some money to us ;-)

Download

S3cmd source code and packages for major linux distributions can be downloaded on our Download page

Simple S3cmd HowTo

The following example demonstrates just the the basic features. However there is much more s3cmd can do. The most popular feature seems to be rsync-like sync command. Check out our s3cmd sync HowTo for more details. Also don't miss out s3cmd encryption HowTo if you're after privacy.

Register for Amazon AWS / S3

Go to Amazon S3 homepage, click on the "Sign up for web service" button in the right column and work through the registration. You will have to supply your Credit Card details in order to allow Amazon charge you for S3 usage. At the end you should posses your Access and Secret Keys.

Run s3cmd --configure

You will be asked for the two keys - copy and paste them from your confirmation email or from your Amazon account page. Be careful when copying them! They are case sensitive and must be entered accurately or you'll keep getting errors about invalid signatures or similar.

You can optionally enter a GPG encryption key that will be used for encrypting your files before sending them to Amazon. Using GPG encryption will protect your data against reading by Amazon staff or anyone who may get access to your them while they're stored at Amazon S3.

Another option to decide about is whether to use HTTPS or HTTP transport for communication with Amazon. HTTPS is an encrypted version of HTTP, protecting your data against eavesdroppers while they're in transit to and from Amazon S3.

Please note: - both the above mentioned forms of encryption are independent on each other and serve a different purpose. While GPG encryption is protects your data against reading while they are stored in Amazon S3, HTTPS protects them only while they're being uploaded to Amazon S3 (or downloaded from). There are pros and cons for each and you are free to select either, or, both or none. Refer to s3cmd encryption HowTo for more details.

Run s3cmd ls to list all your buckets.

As you have just started using S3 there are no buckets owned by you as of now. So the output will be empty.

Make a bucket with s3cmd mb s3://my-new-bucket-name

As mentioned above bucket names must be unique amongst _all_ users of S3. That means the simple names like "test" or "asdf" are already taken and you must make up something more original. I often prefix my bucket names with my e-mail domain name (logix.cz) leading to a bucket name, for instance, 'logix.cz-test':

   ~$ s3cmd mb s3://logix.cz-test
   Bucket 'logix.cz-test' created
   
List your buckets again with s3cmd ls

Now you should see your freshly created bucket

   ~$ s3cmd ls
   2007-01-19 01:41  s3://logix.cz-test
   
List the contents of the bucket
   ~$ s3cmd ls s3://logix.cz-test
   Bucket 'logix.cz-test':
   ~$ 

It's empty, indeed.

Upload a file into the bucket
   ~$ s3cmd put addressbook.xml s3://logix.cz-test/addrbook.xml
   File 'addressbook.xml' stored as s3://logix.cz-test/addrbook.xml (123456 bytes)
 

Note about ACL (Access control lists) — a file uploaded to Amazon S3 bucket can either be private, that is readable only by you, possessor of the access and secret keys, or public, readable by anyone. Each file uploaded as public is not only accessible using s3cmd but also has a HTTP address, URL, that can be used just like any other URL and accessed for instance by web browsers.

   ~$ s3cmd put --acl-public --guess-mime-type storage.jpg s3://logix.cz-test/storage.jpg
  File 'storage.jpg' stored as s3://logix.cz-test/storage.jpg (33045 bytes)
  Public URL of the object is: http://logix.cz-test.s3.amazonaws.com/storage.jpg
 

Now anyone can display the storage.jpg file in their browser. Cool, eh?

Now we can list the bucket contents again
   ~$ s3cmd ls s3://logix.cz-test
   Bucket 'logix.cz-test':
   2008-01-19 01:46       120k  s3://logix.cz-test/addrbook.xml
   2008-11-14 01:46        32k  s3://logix.cz-test/storage.jpg
   
Retrieve the file back and verify that its hasn't been corrupted
   ~$ s3cmd get s3://logix.cz-test/addrbook.xml addressbook-2.xml
   Object s3://logix.cz-test/addrbook.xml saved as 'addressbook-2.xml' (123456 bytes)

   ~$ md5sum addressbook.xml addressbook-2.xml
   39bcb6992e461b269b95b3bda303addf  addressbook.xml
   39bcb6992e461b269b95b3bda303addf  addressbook-2.xml
   

Checksums of the original file matches the one of the retrieved one. Looks like it worked :-)

Clean up: delete the object and remove the bucket
   ~$ s3cmd rb s3://logix.cz-test
   ERROR: S3 error: 409 (Conflict): BucketNotEmpty
   

Ouch, we can only remove empty buckets!

   ~$ s3cmd del s3://logix.cz-test/addrbook.xml s3://logix.cz-test/storage.jpg
   Object s3://logix.cz-test/addrbook.xml deleted
   Object s3://logix.cz-test/storage.jpg deleted

   ~$ s3cmd rb s3://logix.cz-test
   Bucket 'logix.cz-test' removed
   

Ok, ok, I'll put that storage.jpg back up for you ;-)

Other features

Check out our advanced tutorials:

Hints

  • The basic usage is as simple as described in the previous section.
  • You can increase the level of verbosity with -v option and if you're really keen to know what the program does under its bonet run it with -d to see all 'debugging' output.
  • After configuring it with --configure all available options are spitted into your ~/.s3cfg file. It's a text file ready to be modified in your favourite text editor.
  • Multiple local files may be specified for s3cmd put operation. In that case the S3 URI should only include the bucket name, not the object part:
    ~$ s3cmd put file-* s3://logix.cz-test/
    File 'file-one.txt' stored as s3://logix.cz-test/file-one.txt (4 bytes)
    File 'file-two.txt' stored as s3://logix.cz-test/file-two.txt (4 bytes)
    
  • Alternatively if you specify the object part as well it will be treated as a prefix and all filenames given on the command line will be appended to the prefix making up the object name. However --force option is required in this case:
    ~$ s3cmd put --force file-* s3://logix.cz-test/prefixed:
    File 'file-one.txt' stored as s3://logix.cz-test/prefixed:file-one.txt (4 bytes)
    File 'file-two.txt' stored as s3://logix.cz-test/prefixed:file-two.txt (4 bytes)
    

By Michal Ludvig on 22 August 2008

Tags:

---

Comment

  1. Nikunj wrote:

    Hi,

    Is there any convenient way to delete all files under a bucket? I have plenty of files in a bucket. Mentioning wild card characters in the delete command doesn’t work too.

    Thanks!

    ( 3 October 2008, 00:20 · #)

  2. Michal wrote:

    For now I suggest you check out s3cmd trunk from SVN and use recursive delete. For instance:
    s3cmd del —recursive s3://your-bucket/

    ( 3 October 2008, 00:23 · #)

  3. Elmer wrote:

    how about modifying the existing ACL?

    (13 October 2008, 02:34 · #)

  4. Paul Colby wrote:

    Hi, I love your s3cmd tool!! I use it all the time :)

    The “s3cmd sync HowTo” and “s3cmd encryption HowTo” links above are getting 404 error pages :(

    Thanks :)

    Paul.

    ( 1 December 2008, 04:59 · #)

  5. Michal wrote:

    Hi Paul, I know, writing up these two pages is on my short-term ToDo list. Stay tuned ;-)

    ( 7 December 2008, 20:27 · #)

  6. Stefano wrote:

    Hi Michal, I use s3cmd everyday with RightScale server templates and I’m very happy with it. Now I need to install s3cmd on my local server for backup consolidation and I’m really really struggling with it. My server runs SLES 10 64bit with Python 2.4. I added your repository and tried to install s3cmd using Yast: installation fails because Yast cannot resolve the python-elementtree dependency (I don’t know why the package is not available but I cannot find it in my CentOS servers on RightScale too and s3cmd works great anyway). Then I tried installing elementtree, cElementtree and s3cmd from sources and it seems like everityng’s ok. But when I try to connect to my S3 buckets I still have no luck: the error is “ERROR: Test failed: No module named expat; use SimpleXMLTreeBuilder instead”.

    Some hint?

    Thank you

    S

    (15 December 2008, 05:57 · #)

  7. Michal Ludvig wrote:

    Hi Stefano,

    I admit I have never used s3cmd on SLES10. I only verified that it compiles, nothing more. I’ll give it a try and eventually prepare the packages for you. Stay tuned.

    Michal

    (15 December 2008, 12:20 · #)

  8. Michal wrote:

    Hi again Stefano,

    I have finally managed to install SLES10 and made s3cmd work on it. You’ll need to have packages python-devel, python-xml and python-elementtree installed. The last one is a bit tricky though. I have added a howto on to the s3cmd RPM repositories page, have a look there for more details.

    Michal

    (15 December 2008, 20:34 · #)

  9. Stefano wrote:

    Great job. It works smoothly. Thank you so much Michal.

    Last notice: at the moment s3cmd rpm package requires just python and python-elementtree as needed dependencies. Not python-devel and python-xml, so you have to install them manually.

    Maybe this should be fixed for easier installation.

    Thank you again.

    S

    (16 December 2008, 03:29 · #)

  10. s3cmd fails to run on Windows XP wrote:

    If s3cmd ( or any of your software ) is not designed to run on Windows, please do mention the supported OS in your FAQ. ( if it is mentioned on your site and I missed it, it may help to mention in FAQ )

    After reading the HowTo for s3cmd, I was quite impressed at how easy it seemed and decided to try it out, but after trying it, I felt frustrated at spending my time over an software not supported on Windows. As it is written python, I expected it to work on all platforms supported by python.

    I was able to install s3cmd on Windows XP by changing setup.cfg
    [install]
    prefix = /usr

    TO

    [install]
    prefix = c:\python25

    but

    s3cmd s3cmd-0.9.9-pre3 fails to run on Windows XP with python 2.5.2

    C:\Python25\Scripts>python s3cmd
    Traceback (most recent call last): File “s3cmd”, line 14, in <module> import pwd, grp
    ImportError: No module named pwd

    (26 December 2008, 16:14 · #)

  11. Jon Hurst wrote:

    Just a quick feature suggestion. S3 seems to allow a url to be generated that gives those who have it access to a file in your private bucket. The obvious use for this is emailing friends a url so they can access particular photos. It would be superb if s3cmd could generate these urls.

    Thanks for your excellent work.

    Jon

    ( 3 January 2009, 07:19 · #)

  12. Michal wrote:

    Hi Jon,

    s3cmd at the moment can only set public flag on objects and generate URL for them.

    I’ll put your request on a wish list though and probably implement it in one of the upcoming versions.

    Michal

    ( 4 January 2009, 19:25 · #)

  13. Michal wrote:

    Re Windows XP – s3cmd 0.9.9-pre4 should install and run on Windows XP again.

    ( 4 January 2009, 20:31 · #)

  14. george hill wrote:

    links on this page to s3cmd encryption howto and s3cmd sync howto both 404. http://s3tools.logix.cz/s3cmd-encryption 404
    http://s3tools.logix.cz/s3cmd-sync 404

    (13 January 2009, 08:50 · #)

  15. Jason wrote:

    So far so good. I was able to back up all my important stuff last night. Sync works nicely though I would like some better exclusion options (don’t backup subfolders, exclude specific/multiple folders or file types). Donation made. Keep up the good work!

    Also, had to make some minor mods to support Python 2.6 in Win32 (deprecated libraries).

    (19 January 2009, 20:04 · #)

  16. Jim wrote:

    Hi.
    I’ve been looking at this. All seems pretty simple, but I have a question about the encryption.

    I was following the setup described here using encfs and s3cmd

    http://sharph.net/2008/12/encrypted-offsite-backup-with-encfs-amazon-s3-and-s3cmd/

    But the s3cmd man page mentions the —encrypt flag, which seems to do the same thing ie make sure that all the files on S3 are unreadable.

    Is the —encrypt flag on its own sufficient? Certainly a lot simpler ….

    (28 January 2009, 01:25 · #)

  17. Michal Ludvig wrote:

    Hi Jim,
    the unfortunately s3cmd doesn’t support GPG encryption for ‘sync’ command yet. It will in the not so distant future, but at the moment (s3cmd 0.9.9) it doesn’t.

    You can do ‘put —encrypt’ though, but that would upload all the files every time. Unfortunate, I know. I’ll work on adding sync+GPG as soon as time permits.

    Subscribe to our ‘announce’ list if you’d like to get notified once this feature is ready.

    Michal

    (28 January 2009, 03:00 · #)

  18. khalemi wrote:

    is there any way to backup/sync a directory recursively?

    s3fs put / s3://bucket/else/

    doesn ot work

    (28 January 2009, 21:46 · #)

  19. Mario wrote:

    Hi,
    I’m looking how to create a sub directory on s3 whit s3cmd. I have tried: s3cmd mb s3://directory/sub_directory unfortunately this command don’t work.
    Is it an other way to do that?
    Thanks for your answers.
    Mario

    ( 2 February 2009, 06:50 · #)

  20. Michal Ludvig wrote:

    khalemi, use ‘s3cmd put —recursive’ or ‘s3cmd sync’. Sync is recursive by default.

    ( 2 February 2009, 19:11 · #)

  21. Michal Ludvig wrote:

    Mario, there’s no need to explicitly create directories.

    Simply do ‘s3cmd put blah.txt s3://bucket/what/ever/’ and it’ll do all the work for you and save the file as s3://bucket/what/ever/blah.txt

    In fact there’s nothing like a ‘directory’ in S3 – the whole /what/ever/blah.txt is the filename, it looks like it comprises of two directories but technically it doesn’t. As soon as you delete it, the /what/ever/ will disappear. S3cmd doesn’t yet have a concept of remote directories (although it eventually will one day) as in most cases they’re not needed.

    ( 2 February 2009, 19:19 · #)

  22. Mario wrote:

    Thank you so much for your answer! That’s work fine!
    Mario

    ( 3 February 2009, 05:54 · #)

  23. Neil Bothwick wrote:

    Is there a way to limit the bandwidth that s3cmd uses, in the way that rsync’s —bwlimit argument does. s3cmd works well, but it can make my Internet connection very slow for other use while it is using all my upstream bandwidth.

    (10 February 2009, 05:45 · #)

  24. Michal Ludvig wrote:

    Neil,

    at the moment there is no way to limit bandwidth. I’ve seen a patch in this regard some time ago but it has never been integrated applied to the official s3cmd.

    I’ll add it to my TODO list.

    Michal

    (10 February 2009, 16:16 · #)

  25. Neil Bothwick wrote:

    Thank you very much.

    (10 February 2009, 17:17 · #)

  26. D Miller wrote:

    I have s3 running fine in a sh script on an old fc2 install. I am getting an error when trying to run the same file from cron:

    X-Cron-Env: <SHELL=/bin/sh>
    X-Cron-Env: <HOME=/root>
    X-Cron-Env: <PATH=/usr/bin:/bin>
    X-Cron-Env: <LOGNAME=root>

    Traceback (most recent call last): File “/home/webadmin/repairs/s3tools/s3cmd-0.9.1/s3cmd”, line 9, in ? import logging
    ImportError: No module named logging

    Is there some environment variable i need to set in crontab to make python happy?

    Thanks —

    (16 February 2009, 18:18 · #)

  27. Paul Colby wrote:

    I just saw what looks like the final 0.9.9 on Sourceforge… is that true!? … very excited… I’ve been looking forward to the 0.9.9 release for some time now ;)

    paul.

    (16 February 2009, 19:08 · #)

  28. Michal Ludvig wrote:

    Paul Colby, yes, it’s true. s3cmd 0.9.9 is now released. I’ll post an announcement later today. It’ll take some time to write it up as there is a huge load of new features in 0.9.9 ;-)

    (16 February 2009, 19:54 · #)

  29. Michal Ludvig wrote:

    D Miller, go I get it right that running s3cmd from the shell works while from cron it doesn’t? Are there any environment variables starting with PYTHON set in the shell? Do ‘set | grep PYTHON’ and see.

    BTW s3cmd 0.9.1 is really really really old. If at all possible upgrade to 0.9.9 that has just been released.

    (16 February 2009, 20:00 · #)

  30. Zac Spitzer wrote:

    great tool

    one thing which is really needed is path delimiter translation on Windows, s3cmd is uploading directory paths using the \ delimiter rather than converting them to /

    something like this

    if not os.path.normpath(”/”) == “/”: string=string.replace(’\\’,’/’)

    in utils.py line 224 worked for me

    proxy username and password options would be nice for those of stuck behind dump corporate firewalls at times, grrrr :)

    (18 February 2009, 09:35 · #)

  31. Michal Ludvig wrote:

    Zac,
    on Windows it’s more difficult – the path delimiters will have to be converted on multiple places to allow, for instance, for names comparisons in ‘sync’. So it’s not that easy. I’m more less waiting for someone to step up and send me a comprehensive patch with Windows support. I don’t personally use MS Windows and have no intentions to change my habits in this regard ;-)

    Michal

    (18 February 2009, 13:24 · #)

  32. Zac Spitzer wrote:

    sync is working fine for me with that single change..

    (20 February 2009, 08:10 · #)

  33. Michal Ludvig wrote:

    Ah, ok then. Thanks for a report ;-)

    (20 February 2009, 11:50 · #)

  34. Zac Spitzer wrote:

    cool :)

    have you though about a parallel dir parameter

    ie —parallel-dir=5

    which would then sync 5 dirs at a time, goo when you have lots of small files

    i wish s3 supported uploading a zip which then gets extracted as files, http is pretty chatty and inefficent

    z

    (20 February 2009, 18:59 · #)

  35. Peter wrote:

    Thanks for this, the —recursive has been quite handy, I had about 2000 files in a bucket that started with ‘-’ so i couldn’t use the ec2-delete-bundle like i had done previously, if it wasn’t for this i would have had to delete all those files one by one :D

    (23 February 2009, 03:50 · #)

  36. locksmith wrote:

    hi thx for the great tool.
    sometimes i keep getting RequestTimeout esp when syncing a large number of files. any way to prevent that? thx!

    ( 5 March 2009, 06:23 · #)

  37. Vincent Wang wrote:

    Hi, thanks for your excellent work!

    I encounter an issue right now, when I upload a file whose name includes some chinese words, s3cmd gives me following errors:

    $ s3cmd put 测试.py s3://mysandbox
    测试.py -> s3://mysandbox/ [1 of 1] 24 of 24 100% in 1s 18.71 B/s done
    ERROR: S3 error: 400 (MalformedXML): The XML you provided was not well-formed or did not validate against our published schema

    Does s3cmd support above kind of files uploading?

    thanks.

    (12 March 2009, 20:46 · #)

  38. Michal Ludvig wrote:

    Hi Vincent,

    yes, there is a bug in s3cmd that causes this error. To work around it add a slash at the end of your bucket name. Ie:

    s3cmd put 测试.py s3://mysandbox/

    That should fix it.

    Michal

    (12 March 2009, 21:10 · #)

  39. Vincent Wang wrote:

    Hi, Michal

    Your reply is really quick! :)

    The method works for me well, thanks.

    (12 March 2009, 21:16 · #)

  40. Ivan wrote:

    Support for symbolic links would be great. Other than that, great product!

    (13 April 2009, 12:39 · #)

  41. Nikolay wrote:

    Should “s3cmd sync” support files deletion from destination folder in case they have been deleted in source folder?
    I believe, “sync” means that two folders should be same after sync.

    ( 1 May 2009, 09:28 · #)

  42. Michal Ludvig wrote:

    Nikolay: It does. Use —delete-removed switch. For more options see s3cmd —help

    ( 1 May 2009, 17:02 · #)

  43. Satish wrote:

    Do you support creation of EU buckets at the moment ?

    Satish

    ( 6 May 2009, 03:34 · #)

  44. Albert Lash wrote:

    Hi – is there a way to force copying a file to a “directory” target? For example, if I wanted to copy an index file to a key that ends in a “/”, to replace directoryindex functionality. Whenever I try to do this with s3cmd, it puts it into a directory.

    Thanks!

    ( 7 June 2009, 12:18 · #)

  45. Ted Mokita wrote:

    Hi,
    Just a question. Does this works with Gentoo? I tried to install it but did not find out because of MASKED PACKAGES related to net-misc/s3cmd
    Thanks

    (10 June 2009, 11:28 · #)

  46. Michal Ludvig wrote:

    Hi Ted,

    there’s no reason why it shouldn’t work on Gentoo.

    Simply grab the distribution tarball from SourceForge, unpack and run:

    python setup.py install

    That’s it.

    Michal

    (10 June 2009, 18:00 · #)

  47. ted wrote:

    Thanks.
    This is the message:

    myserver# python setup.py install
    No module named etree.ElementTree
    No module named elementtree.ElementTree
    Please install ElementTree module from
    http://effbot.org/zone/element-index.htm

    python version installed on Gento is 2.4.4
    I did not find the good module

    (15 June 2009, 09:58 · #)

  48. Rahul wrote:

    I am trying to run s3cmd from crontab, but it’s not working at all, If i manually run the script it works fine. “ sh test.sh “

    same problem i was facing in other servers, I just added “ HOME=/root “ env in my script & everything worked :).

    But for one server i am not able to correct my problem.
    More information : Server on which i am facing the problem is being hosted on “Verio Service provider, There is no root login available , I have to connect as root2.
    Please help me to set env for this server in my script.

    (22 June 2009, 06:37 · #)

  49. David wrote:

    Is there a way to remove files from buckets that have reached a given age?

    Or do we need to write our own script that does an “s3cmd ls BUCKET” and parse the dates ourselves to determine if the file is older than some limit? Anybody have such a script already? Is it built into s3cmd?

    Thanks.

    (24 June 2009, 16:17 · #)

  50. Anonymaster wrote:

    Nice tooooll :)

    (20 July 2009, 18:06 · #)

  51. ReaderX wrote:

    I ran line command to install this in Terminal on my Mac. How do you uninstall? There seems to be no instructions about removing s3cmd from your system.

    I no longer need it and want to uninstall.

    (31 July 2009, 21:44 · #)

  52. ohmi wrote:

    Love this tool. The only thing I wish for is a command that returns the signed GET url for a given bucket/object with an expiry in hours:

    s3cmd geturl s3://bucket/object 24

    Of course minutes or seconds would be fine too or —noexpire, something like that.

    This would allow scripts to publish content without messing with ACLS

    (10 August 2009, 23:50 · #)

  53. Sumit Khanna wrote:

    Hi,
    Can I copy files between directories using a wild card?
    Eg:
    s3cmd cp s3://XYZ/20090801/*Activity* s3://XYZ/Activity/20090801/.

    (12 August 2009, 19:48 · #)

  54. David wrote:

    How do I excavate this software from my Ubuntu machine ? 0.9.9 spews up errors for all commands, and I can’t revert to any earlier versions :-(

    Even installing an earlier version, “s3cmd —version” still reports 0.9.9 …

    (13 August 2009, 20:46 · #)

  55. Son Tran wrote:

    Hi,

    To trim down our S3 storages, we want to delete hundreds of millions of files. They com from different selected locations. As a result, we cannot perform deleting at the bucket level.

    Currently, if we do “s3cmd del one_thousand_name_list.txt”, the program would delete the files in the list sequentially and report each name deleted. It would take .3 sec per file.

    Do you have any suggestion for speeding up this process?

    Thanks a lot
    Son

    (18 August 2009, 23:46 · #)

  56. Michal Ludvig wrote:

    Hi Son,

    use s3cmd-speedup branch. A tarball for s3cmd-0.9.9-rc3-speedup can be found in ‘testing’ folder of s3tools project on SourceForge.

    That one should operate much faster but doesn’t work from behind a proxy.

    Michal

    (18 August 2009, 23:53 · #)

  57. Son Tran wrote:

    Thanks a lot Michal
    s3cmd-speedup is almost three times faster! (for us, now it is ~0.13 sec/file)

    Son

    (19 August 2009, 19:23 · #)

  58. Ross Lai wrote:

    Hi,
    I use s3cmd as
    s3cmd sync —delete-removed s3://rossbkt/1st_update test_case/
    Try to see if syncronization works.
    And I could see the following message:
    Summary: 0 remote files to download, 2 local files to delete
    deleted ‘logs.ppc’
    deleted ‘logs.all’
    Done.

    But when I list test_case/, I still find logs.ppc and logs.all existed.
    This is these two files property

    -rwxrwxrwx 1 root root 104517316 2009-09-15 18:22 logs.all
    rw-r-r— 1 root root 620567 2009-09-15 18:27 logs.ppc

    Are there any limitation to use “s3cmd sync —delete-removed”?
    Please remind me, thank you.

    (16 September 2009, 16:14 · #)

  59. Jesse wrote:

    When I do a sync from a windows host it creates files with backslashes in them. How do I get s3cmd sync to upload a valid tree from a windows host?

    (11 November 2009, 08:45 · #)

  60. skarayan wrote:

    The link http://s3tools.org/s3cmd-encryption is broken.

    Can someone please check?
    Thank you.

    (21 November 2009, 08:59 · #)

  61. Sriracha wrote:

    On windows vista, the program will not terminate once the file has been copied to amazon. Press return, and I then get the output.

    Is this expected? Any way to get it to return automagically?

    (25 November 2009, 09:51 · #)

  62. João Sena Ribeiro wrote:

    To change the ACL of an existing file to public:

    > s3cmd setacl —acl-public s3://bucket/file

    To change the ACL of an existing file to private:

    > s3cmd setacl —acl-private s3://bucket/file

    (30 November 2009, 02:12 · #)

  63. Perry wrote:

    Hi, 2 things.

    1) When using s3cmd-0.9.9-rc3-speedup as:

    $ ./s3cmd cp —recursive —force s3://bucket/dir1/ s3://bucket/dir2/

    …I receive: “ERROR: S3 error: 404 (NoSuchKey): The specified key does not exist.

    I believe that’s an S3 Object error.. I receive no such error when using s3cmd-0.9.9.91; I need it to be faster…any advice?

    2) Regarding the parameters in the ~/.s3cfg: “recv_chunk“ & “send_chunk“. What exactly do they represent (bits, bytes, blocks, etc.), and is it safe to modify them (using what as a guide)?

    ( 5 December 2009, 06:55 · #)

  64. Liam wrote:

    Great tool! Now… what about copying from one bucket to another using x-amz-copy-source?
    That would be a fantastic feature. As it is, I’m not finding any other options to do this easily with about 680,000 objects.

    Thanks for writing it, it’s making things easier.

    ( 7 December 2009, 18:09 · #)

  65. Niro wrote:

    I’ve installed on CentoOS5 and have a problem:

    s3cmd runs beautifully from command line as admin but fails to run with shell_exec from PHP script. The problem is probably that the php script owner is ‘apache’ which is not the shell root user.

    How can I install s3cmd so that it can be run using shell_exec() by php script owned by apache user?

    Note: I installed using yum install command.

    ( 7 December 2009, 21:11 · #)

  66. David wrote:

    I got the ElementTree error when I tried to use s3cmd. The thing is, I don’t know how to use YaST, and I can’t find it as /usr/lib/Y* or anywhere on my WHM cPanel (both as root). So I guess I’m stuck. And I was so looking forward to using s3cmd! This is my sysinfo:

    Linux vps.arqvx1.com 2.6.18-028stab064.7 #1 SMP Thu Aug 20 20:58:14 MSD 2009 i686 i686 i386 GNU/Linux

    David

    (28 December 2009, 18:46 · #)

  67. s3user wrote:

    Hi Mike, thanks for the great tool. I was trying to use s3cmd to copy a content of a large bucket (150K+ objects) and got the following error:

    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    An unexpected error has occurred. Please report the following lines to: s3tools-bugs@lists.sourceforge.net

    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    Problem: KeyErr: ‘dest_name’
    S3cmd: 0.9.9.91

    Traceback (most recent call last): File “/usr/bin/s3cmd”, line 1736, in ? main() File “/usr/bin/s3cmd”, line 1681, in main cmd_func(args) File “/usr/bin/s3cmd”, line 578, in cmd_cp subcmd_cp_mv(args, s3.object_copy, “copy”, “File %(src)s copied to %(dst)s”) File “/usr/bin/s3cmd”, line 568, in subcmd_cp_mv dst_uri = S3Uri(item[‘dest_name’])
    KeyError: ‘dest_name’

    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    An unexpected error has occurred. Please report the above lines to: s3tools-bugs@lists.sourceforge.net

    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    ( 1 January 2010, 01:46 · #)

  68. Jake wrote:

    Add me the list of enthusiastic supporters of s3cmd. Thanks for your hard work Mike.

    I’d like to use s3cmd to get a subset of objects/files from one my buckets. I’ve already generated a text file of s3 URIs that match the set of objects I want to get (by grepping out the files that match my criteria from ‘s3cmd ls’ and then using sed to strip out the date/time stamp and file size). EG:

    s3://[BUCKET]/[OBJECT]

    Is there a way to pass this list to ‘s3cmd get’? All my attempts to include this file (or a modified version that just has ‘/[BUCKET]/[OBJECT]’ references) using —include-from have failed.

    Thanks,

    Jake

    ( 9 January 2010, 08:26 · #)

  69. John George wrote:

    Can you provide a sample configuration to use s3cmd with Open Eucalyptus Walrus?

    (26 January 2010, 03:55 · #)

  70. Eduardo Costa wrote:

    Excellent tool! Tiny, simple and very functional! Thanks a lot!

    (28 January 2010, 05:02 · #)

  71. Term Paper wrote:

    I have some problem about S3cmd,But Now I am satisfy Because your uploading S3cmd command line tool,

    (28 January 2010, 21:17 · #)

  72. Term Paper wrote:

    I have some problem about S3cmd,But Now I am satisfy Because you are uploading S3cmd command line tool,

    (28 January 2010, 21:18 · #)

  73. Akshay wrote:

    Hi,

    How can i copy files from one bucket to another bucket using s3cmd.

    (15 March 2010, 04:40 · #)

  74. Boulderdash wrote:

    Will it support versioning ?

    (17 March 2010, 21:40 · #)

  75. Robert wrote:

    Hi!

    The link to “s3cmd encryption HowTo” ist dead…where can i get the howto?

    Best regards
    Robert

    (27 March 2010, 02:56 · #)

  76. Ash wrote:

    Hi,

    How to list the total number of files in a S3 bucket and the total size of a bucket?

    I could not find any command for these.

    Appreciate your help.

    ( 8 April 2010, 02:55 · #)

  77. Luis Fernandez wrote:

    It seems s3cmd does not work with file of 2bg or over. I’m trying to send a video file that’s slightly over 2gigs but wont do it. I noticed php scripts have the same problem. Any insight? Thanks.

    (27 May 2010, 12:00 · #)

  78. Joe R wrote:

    Great tool and thanks for laying out the basic steps right here so it’s easy to do each time for people like me who can’t remember what I ate for breakfast. I just sent you $20.

    (28 May 2010, 07:16 · #)

  79. kevin wrote:

    I love the simplicity of this tool! Thanks!

    btw
    1) how can I select the region for creating a new bucket?
    2) is there anyway I can speedup my uploads?

    (28 July 2010, 22:53 · #)

  80. Peter Kepes wrote:

    Hi,

    I’m trying to use your script for backup on our servers. On one server it always interrupt uploading with (104, ‘Connection reset by peer’) and restart it slower speed around 300K / sec which is too slow. I googled it and found there is some kind of timing problem in python (http://homepage.mac.com/s_lott/iblog/architecture/C551260341/E20081031204203/index.html). Unfortunately I’m not a python programmer but I can found time.sleep(throttle) in your code (S3.py) and can change throttle from 0.01 to 0.0001 which works well for me with much faster uploading speed. I suggest you should change S3.py in official s3cmd source and maybe add a new switch to change default throttle.

    I like your script thanks for the good work!

    (10 August 2010, 00:19 · #)

  81. Carel Jonkhout wrote:

    Ash:

    To list to number of files in a bucket just do this in a posix shell the first wc outputs is the number of lines:

    s3cmd list yourbucket: | wc

    (29 August 2010, 09:17 · #)

  82. Eric wrote:

    Hello,

    First, I would like to thank you for creating s3cmd – it is very useful indeed.

    My question: Is there an easy way to use s3cmd to delete files that are older than a certain date from a bucket? I would like to have a shell script that uploads gzipped backups to S3 every day, and to have the script also delete files that are older than, say, 30 days. I have not found a way to do this yet with s3cmd..

    Thanks!

    (13 September 2010, 12:25 · #)

  83. Tim N wrote:

    Love this tool!

    You might want to add a mention to the docs for —recursive option impact/use with the ls command. Without it, ls returns only objects at the top/requested level, not all objects which start with the given BUCKET[/PREFIX].

    (17 September 2010, 05:38 · #)

  84. Chris wrote:

    Thanks a lot! (to keep it short)

    I’ve now the situation that I had to copy files between two Buckets. In the Moment it’s only possible with “get & push”, isn’t it?

    So I’m not the first one who ask it in this thread: Is there any possibility to copy Files between Buckets?

    There’s no answer yet!?

    (24 September 2010, 01:40 · #)

  85. Henryc wrote:

    What mechanism is used to verify data integrity of the backed up files?

    I see example where you upload then download then md5sum..but that would take forever with a large set of files

    (14 October 2010, 07:08 · #)

  86. Kevin B wrote:

    I’m sure I’m missing something but I can’t seem to figure out how to restore a test file and maintain the original date stamp (05/26/2010) of the test file?

    I can see through the AWS Manager Console that it has the correct information under the metadata

    uid:843/gid:840/mode:33188/mtime:1274892145/atime:1285729115/ctime:1285729115

    But no matter what I try when I bring the file back to my server it has today’s date.

    I have tried:

    s3cmd get s3://myamazonbucket.com/file.txt file.txt

    s3cmd get -p s3://myamazonbucket.com/file.txt file.txt

    s3cmd get —preserve s3://myamazonbucket.com/file.txt file.txt

    Any guidance would be greatly appreciated.

    s3cmd version 0.9.9.91

    Sincerely,
    Kevin

    (14 October 2010, 17:35 · #)

  87. Kevin B wrote:

    To further on the above post I gave up on getting it to work with one file and thought maybe it only works when you do a sync so I tried a sync with a directory and a few files.

    When I synced them back to my server all the files within the directory maintained the correct dates but the folder had the current date rather than the original date?

    Is there a way to make the folders keep their original date?

    Sincerely,
    Kevin.

    (14 October 2010, 18:40 · #)

  88. Adam wrote:

    Hello,

    I am trying to use s3cmd to copy files in S3 from one bucket to another. I have empty files that represent directories that are intentionally there since some of the directories are just empty directories, rather than just files. Effectively we have an EFS filesystem for eclipse build over S3. That being said, at the moment s3cmd ignores all the “directory” files. Is there a way to get it to stop ignoring them?

    Sorry if I missed something really obvious.

    Thanks,
    Adam

    (19 October 2010, 13:40 · #)

  89. Andres wrote:

    Is there a command to limit the amount of bandwidth used during a sync, get or put process?

    (29 October 2010, 10:58 · #)

  90. Brad wrote:

    Is there any way to pick the endpoint?

    Say i want to create a bucket at:
    s3-us-west-1.amazonaws.com, when I put this in the config it gives me:

    ERROR: S3 error: 400 (Bad Request): IllegalLocationConstraintException

    (13 November 2010, 14:53 · #)

  91. jerry u wrote:

    http://s3tools.org/s3cmd-encryption
    404’s by the way. you reference it above.

    (18 November 2010, 16:17 · #)

  92. chris wrote:

    Is there a way to run this through PHP? I have done some searching and can not find a solution. I know there are .php s3 files out there but I would like to get this one going at the command line as I am processing other things.

    (20 November 2010, 14:31 · #)

  93. john wrote:

    Is there a complete tutorial on configuring s3cmd to run on cron? I have problems running it on cron but running on command line is fine. they say its environment settings. I tried that but I still can run s3cmd on cron successfully.
    Thanks

    ( 4 December 2010, 05:29 · #)

  94. Michal Ludvig wrote:

    john: the only difference when running from cron is that you’ll have to explicitly specify the config file with —config=/some/where/s3cmd.cfg

    Make sure to use an absolute path and also make sure that the file is readable by the user under which the cron job runs. That’s all that is needed for running s3cmd from cron.

    ( 5 December 2010, 23:20 · #)

  95. john wrote:

    Thanks for the quick response Michal..
    You said about specifying where the s3cmd.cfg path.
    So if this is my script, I should just add the line where s3cmd.cfg exists?

    #! /bin/bash
    /home/ubuntu/s3cmd-0.9.9.91/s3cmd put file s3://bucket
    PATH=$PATH:/home/ubuntu/.s3cfg
    export PATH

    On my case I searched for s3cmd.cfg, but I think it is name .s3cfg which is stored on my home directory.

    ( 6 December 2010, 17:09 · #)

  96. Thiago wrote:

    Does s3cmd automatically support uploading files over 5GB now that Amazon has lifted the limit to 5TB?

    (15 December 2010, 05:54 · #)

  97. Pavel wrote:

    Yes I’m interested in this too. Anyone knows when it’ll support the new multi-part object upload?

    (17 December 2010, 09:56 · #)

  98. Andre wrote:

    Another vote for multi-part upload. Would love to see it as part of s3cmd!

    ( 4 January 2011, 13:44 · #)

  99. Fred wrote:

    great work, this tool is really handy. It’s awesome how i can integrate it with my shell scripts

    ( 5 January 2011, 17:19 · #)

  100. Dan Webster wrote:

    I’ll also put in my vote for supporting >5Gb uploads. That would be tremendous. Keep up the good work, we all appreciate it!

    Dan

    ( 9 January 2011, 12:13 · #)

  101. Matthew wrote:

    Very useful tool, I use it a lot.

    Many thanks.

    (12 February 2011, 02:36 · #)

  102. newly domains wrote:

    How to list files in a dir?

    s3cmd ls bucket dir???

    (15 February 2011, 22:34 · #)

  103. Marcos Ramírez wrote:

    Run from init.d fails.

    Hi, im trying to fetch some files on instance init.d, with no result, from command line script works fine, but not on init.d.

    I need to setup something?

    Regards

    (16 February 2011, 23:02 · #)

  104. Henry Rusted wrote:

    Great tool, easy to use and works.

    One feature I would love is to be able to use data from stdin as source for the put command. I tried:

    date | s3cmd put – s3://bucket/blah/date_started

    and

    s3cmd put <(date) s3://bucket/blah/date_started

    but neither worked.

    s3cmd get s3://bucket/blah/date_started –

    works fine, writing the content to stdout.

    ( 1 March 2011, 02:54 · #)

  105. Michal wrote:

    Hi Henry,

    Upload from stdin is not (yet) possible. There used to be some challanges with Amazon’s S3 API that prevented this functionality. Now with the recently introduced multipart upload it will be possible but is not yet implemented.

    ( 1 March 2011, 03:00 · #)

  106. flm wrote:

    Great tool.
    Would be nice to be able to pipe in order to do things like mysqldump mydb | s3cmd put s3://mys3

    FL

    ( 4 March 2011, 06:02 · #)

  107. flm wrote:

    Ah ! I didn’t read the previous comment and its answer. Henry’s suggesting exactly the same thing. Thanks Michal for investigating.

    ( 4 March 2011, 06:08 · #)

  108. Dan wrote:

    This tool is outstanding, but there one thing that would make it perfect: >5Gb uploads.

    I will donate as much as I can (not saying much, grad student salaries being what they are) if that would provide any extra incentive to implement this.

    Thanks!

    (11 March 2011, 20:00 · #)

  109. Justin wrote:

    You are a scholar and a gentleman. I’d knight you if it had symlink support. :)

    (16 March 2011, 07:07 · #)

  110. Justin wrote:

    Does anyone know of a good strategy so that I can use this tool to upload backups from my server to S3 in a way so that if my server was unknowingly and completely compromised, my S3 backups would still not be delete-able?

    One requirement is that the backups are non-interactive. My problem is that the .s3cfg file that is saved has the secret access key, which gives an attacker full access to S3.

    AFAICT, the only way around this would be if you could upload to S3 authenticated by a write-only (and with no permission to delete) set of credentials, which don’t seem to exist.

    Perhaps I am missing something?

    Thanks,
    Justin

    (16 March 2011, 07:21 · #)

  111. Jeremy wrote:

    Please consider merging the excellent —parallel option developed here: https://github.com/pcorliss/s3cmd-modification

    It does parallel transfers, dramatically speeding up operations that involve large numbers of small files.

    (17 March 2011, 12:44 · #)

  112. Aleksander Ohlens wrote:

    I am using the parallel patch and it is a life saver that has turned 2 day transfer queues into hours. It would be great to see it included in s3cmd natively.

    (18 March 2011, 04:03 · #)

  113. sidakala wrote:

    This is such a great resource that you are providing and you give it away for free. I love seeing websites that understand the value of providing a quality resource for free. It’s the old what goes around comes around routine.

    <a href=“http://ekspressfinans.net/”>lÃ¥n uten sikkerhet</a>

    (23 March 2011, 09:30 · #)

  114. chandra wrote:

    I am using s3cmd 0.9.9.91. I am trying to upload 1500 files using the following command:

    s3cmd -f -c /root/.s3cfg put /mnt/mfiles/*.fq1 s3://test-repeat/

    I am getting the following error.

    /usr/bin/s3cmd: Argument list too long

    Could you please help me in resolve this issue?

    Thanks

    (24 March 2011, 10:42 · #)

  115. undersys wrote:

    Is there anyway to format the “ls” command so that we can sort by date ?

    So when we #s3cmd ls s3://bucket/
    It gives a list formated so that the listing is oldest to newest file or other way around?

    Currently this is not the case.

    ( 4 April 2011, 19:40 · #)

  116. SomeInternee wrote:

    As I upload some 0.5gb files (Splitted files because they might be too large for upload) s3cmd prints “Upload failed” and restarts the upload…
    I skip that retry, because taking a look at S3 at the AWS Management Console the file appears a minute later.

    Is there a flag for skipping that retry?

    ( 6 April 2011, 23:25 · #)

  117. bakes wrote:

    Awesome tool!

    I am writing my own python app that needs to connect with S3 to get and put files. I am using your S3 module from within my own code and I am using your s3cmd python script as example code to help me understand how to use the S3 module.

    Any chance you would consider tweaking the S3 library to make it more usable as a 3rd party python module? and publishing it to somewhere like github or PyPi?

    ( 8 April 2011, 11:43 · #)

  118. Morning wrote:

    Can s3cmd tool run Windows Platform?
    I run s3cmd tool on Windows Platform,it runs error
    For example,I input command:
    python s3cmd mb s3://zxf

    s3cmd returns information as following:
    ERROR: Option —progress is not yet supported on MS Windows platform. Assuming – -no-progress.
    ERROR: syntax error: line 1, column 61
    ERROR: Parameter problem: Bucket contains invalid filenames. Please run: s3cmd f
    ixbucket s3://zxf/

    (12 April 2011, 19:49 · #)

  119. altyazi wrote:

    I didn’t like this S3 at all.

    (22 April 2011, 18:06 · #)

  120. Linux Solaris wrote:

    Works well on both linux and solaris operating systems.

    (23 April 2011, 13:13 · #)

  121. Mohit Batra wrote:

    Hi Everyone, Is there any tool for Windows OS just like s3cmd that I can use….its urgent….any help will be appreciated……

    Alternatively, mail me at mohit4677@gmail.com

    (23 April 2011, 20:26 · #)

  122. T S wrote:

    From the documentation, I would expect this command line:

    s3cmd sync —exclude=’/my/path/excluded’ /my/path s3://backup-stuff

    to sync everything under /my/path except what’s in the /my/path/excluded dir.

    This does not, however, appear to be the case – the exclude is totally ignored.

    I’ve tried variations like —exclude=/my/path/excluded/ and —exclude=/my/path/excluded/* with similar lack of success.

    Am I misunderstanding the documentation or is this a problem with the software?

    s3cmd version 1.0.0 on Ubuntu 10.04

    (28 April 2011, 04:39 · #)

  123. Jason Merkin wrote:

    Is there a hard-coded limit tot he file size that we can upload? Amazon’s limit is set to 5TB, but attempts with files larger than 5gb fail shortly after beginning.

    ( 5 May 2011, 08:11 · #)

  124. Jason Merkin wrote:

    In response to my last comment, it seems that files above ~5G will be blocked somewhere on amazon’s end. They have no official stance on it, and their tech support had no idea about ways around it. I had a lot of files to upload, so I used a couple bash one-ish-liners:

    1) this will put all your files from $dir_to_copy into $split_dir in chunks no greater than 4G. it will also copy all the smaller files to the new directory so you can then upload all the files from that directory rather than figuring out which were copied. a hard link would probably be more appropriate for files that are smaller than 4G, but i wasn’t thinking and this was what i did.
    $ for i in `ls $dir_to_copy/`; do s=$(stat -c %s $dir_to_copy/$i); echo $i; if test $s -gt 4200000000 ; then split -b 4G $dir_to_copy/$i $split_dir/$i. ; else cp $dir_to_copy/$i $split_dir/$i; fi; done

    2) when i was uploading, a single file would transfer at ~1M/s while multiple transfers each went at ~1M/s (probably a cap on amazon’s end), so there was no reason to do them sequentially. this starts a detached screen session named for the file and copies it. you can do this for many files at once in a loop.
    $ screen -d -m -S $f /path/to/s3cmd -c /path/to/.s3cfg —progress -v put /path/to/$f s3://$bucket

    no deep insights, but i wanted to share my experience since this took a bit of time and back and forth with amazon to figure out.

    ( 7 May 2011, 05:25 · #)

  125. notohala wrote:

    Our life is vary short but we have many thinks

    to do what is our life

    <a href=“http://www.google.com”>basir</a>

    ( 7 May 2011, 09:18 · #)

  126. notohala wrote:

    Our life is vary short but we have many thinks to do

    <a href=“http://www.google.com”>basir</a>

    ( 8 May 2011, 03:19 · #)

  127. babatorik wrote:

    for copying multiple files with s3cmd we use this simple script.

    first create same folder in destination bucket.

    the script gets a list of files on source bucket and then copies the files from one bucket to another one by one.

    for i in `s3cmd ls s3://SOURCE_BUCKET/SOURCE_DIR/|awk ‘{print $4}’`
    do

    s3cmd —progress -p cp $i s3://DEST_BUCKET/DEST_DIR/$(basename $i)

    done

    ( 8 May 2011, 05:56 · #)

  128. Hussain wrote:

    Hi all, I’m very new to this concept and i have made much research on s3cmd, but i did not get any good suggestion for running s3cmd in cron job, can anybody tell me how can i run s3cmd from cron tab.

    (31 May 2011, 17:54 · #)

  129. MikeC wrote:

    Hi

    Does —config work on s3cmd get?

    I’m running the following:

    s3cmd —config=/opt/s3/s3.cfg —no-progress -p get $i $destinationFolder

    But get the following error:

    ERROR: Invalid command: u’\u2014-config=/opt/s3/s3.cfg’

    Have tried using -c as well and ensured that the config file has read permissions.

    If I run the same with s3cmd mv then no error.

    Thanks Mike

    ( 1 June 2011, 19:56 · #)

  130. GPN wrote:

    RE the encryption topic, s3cmd is also tested to work with

    http://www.porticor.com/2011/05/s3-encryption-now-available/

    which provides a full-featured security suite on S3 and EC2, including key management.

    ( 1 June 2011, 20:17 · #)

  131. MikeC wrote:

    I’ll answer my own question…. just remove the equals sign

    so the following:

    s3cmd —config=/opt/s3/s3.cfg —no-progress -p get $i $destinationFolder

    should be:

    s3cmd —config /opt/s3/s3.cfg —no-progress -p get $i $destinationFolder

    the s3cmd —help needs updating??

    ( 1 June 2011, 21:37 · #)

  132. Daniel Worth wrote:

    I’d like to add a +1 for supporting pipes.

    (11 June 2011, 04:27 · #)

  133. Dean Hall wrote:

    Is it possible to preserve extended filesystem attributes like file ACLs?

    It’s possible for me to do it manually by storing (and restoring) key-value pairs for extended attributes, but is it possible for s3cmd to do this itself? In a future version maybe?

    (19 June 2011, 17:46 · #)

  134. Dean Hall wrote:

    Mike C,

    The error you’re getting indicates that instead of using two standard dashes in —config, you’re using the Unicode em dash.

    ERROR: Invalid command: u’\u2014-config=/opt/s3/s3.cfg’

    Unicode character 2014 is the em dash: http://www.fileformat.info/info/unicode/char/2014/index.htm

    This usually happens when a web text filter attempts to translate common character combinations into more typographically correct Unicode characters. Is it possible you’re copying-pasting —config instead of typing it yourself?

    (19 June 2011, 17:49 · #)

  135. John wrote:

    Is there a way to add a custom key/value pair (metadata) on a file upon upload?

    What I am really trying to do is this:

    I have a bucket with about 1000 files, and I want to add “Content-Disposition: attachment;” to all of them (so they can be served as download files).

    Is it possible somehow?

    (29 June 2011, 17:25 · #)

  136. 邹志乐 wrote:

    Hi there,

    During my usage of s3 and s3cmd on daily basis, below are some questions I am concerned in using s3cmd, would you give any suggestions? thanks.
    1) Would s3cmd mv guarantee the correctness of the moving operation? This means either moved successfully or the original file is not changed/lost.
    2) Is there a way to control the retry times on failure?
    3) The s3cmd mv often fails on moving files from 500 to several gigabytes, and it would succeed if I changed to first get the file to ec2 instance and then put to the target s3 path. Such thing happens often. Any idea why?
    4) Is there a way to upload a partial uploaded file?

    Below is the error stack of s3cmd during copy. Hope it’s helpful for you as well.
    Traceback (most recent call last):  File “/usr/bin/s3cmd”, line 2006, in <module>    main()  File “/usr/bin/s3cmd”, line 1950, in main    cmd_func(args)  File “/usr/bin/s3cmd”, line 614, in cmd_cp    subcmd_cp_mv(args, s3.object_copy, “copy”, “File %(src)s copied to %(dst)s”)  File “/usr/bin/s3cmd”, line 607, in subcmd_cp_mv    response = process_fce(src_uri, dst_uri, extra_headers)  File “/data/bin/s3cmd/S3/S3.py”, line 311, in object_copy    response = self.send_request(request)  File “/data/bin/s3cmd/S3/S3.py”, line 487, in send_request    return self.send_request(request, body, retries – 1)  File “/data/bin/s3cmd/S3/S3.py”, line 487, in send_request    return self.send_request(request, body, retries – 1)  File “/data/bin/s3cmd/S3/S3.py”, line 487, in send_request    return self.send_request(request, body, retries – 1)  File “/data/bin/s3cmd/S3/S3.py”, line 487, in send_request    return self.send_request(request, body, retries – 1)  File “/data/bin/s3cmd/S3/S3.py”, line 487, in send_request    return self.send_request(request, body, retries – 1)  File “/data/bin/s3cmd/S3/S3.py”, line 489, in send_request    raise S3RequestError(“Request failed for: %s” % resource[‘uri’])
    S3RequestError: Request failed for: /patent.chn/backup/post-etl/main/main_etl.txt.gz

    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    An unexpected error has occurred.    Please report the above lines to:   s3tools-bugs@lists.sourceforge.net
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    ( 6 July 2011, 15:34 · #)

  137. 邹志乐 wrote:

    Hi there,

    Could s3cmd support limiting the amount of returned objects from the “s3cmd ls” operation? It takes rather long time to list if there are thousands of files there.

    thanks in advance.

    ( 6 July 2011, 15:38 · #)

  138. Nicolas wrote:

    +1 : Please consider merging the excellent —parallel option developed here: https://github.com/pcorliss/s3cmd-modification

    It does parallel transfers, dramatically speeding up operations that involve large numbers of small files.

    (27 July 2011, 00:00 · #)

  139. Ravi Menon wrote:

    I have had to create my own command line utility since I have to develop on a proprietary platform (HP Nonstop GUARDIAN).
    However, I have a suggestion for the security of the .s3cfg file:

    The configure step encrypts the AWS credentials using AES encryption with a SALT key generated based on information from the executable (argv0 for C programs) such as inode number or creation timestamp that is unique and will change if the executable is touched in any way.

    This way even if the executable and s3cfg file are hacked, they will be of no immediate use.

    The program will have to do the extra step of decoding the credentials at startup thereafter.

    If the executable is touched in any way, the configure step has to be repeated. A small price to pay for security.

    Hope this helps.

    (30 July 2011, 15:10 · #)

  140. ital1anj0b wrote:

    s3cmd —configure asks for Access Key and Secret Key. This is confusing, as there is also a secret key that is part of the Amazon EC2 Key Pairs for the AWS Management Console.

    The correct names are instead:

    Access Key ID
    Secret Access Key

    ital1anj0b

    (22 August 2011, 13:13 · #)

  141. Tyler Whitney wrote:

    Hey folks,

    For those of you needing to run S3CMD from within PHP, I was trying to do the same exact thing and getting the same blank output as you mentioned.

    If you take a look at Michal’s post #94 you will see that he explains you have to use the —config=/some/where/s3cmd.cfg to specify what config file you want to use for S3CMD if you want to run it under cron… well it is the same thing with PHP too… if you run exec, system, or other command line tool like that within PHP and you specify —config=/some/where/s3cmd.cfg it works wonderfully!

    Hope it helps some of you!

    Tyler

    (16 September 2011, 21:14 · #)

  142. Rémi wrote:

    Hello,

    Is it possible to specify the tmp directory while encrypting file for big files?

    Thanks!

    (21 September 2011, 01:20 · #)

  143. timur x wrote:

    Hello Michal, can you please tell us, when to expect S3 SSE support in s3cmd.

    (Many thanks for the tool!)

    ( 6 October 2011, 11:45 · #)

  144. Istvan wrote:

    Hi Michal,

    great tool, thank you.

    I’ve noticed a problem. sync stores the file metadata as the value of key x-amz-meta-s3cmd-attrs . But when I sync it back to the local disk, the permissions are fine, but the user, group and other is not set properly. The user and group becomes the same as the user and group who runs s3cmd. The same with get -p.

    Is that a bug or known issue?

    Thanks!

    (13 October 2011, 05:44 · #)

  145. Rick wrote:

    timur x,

    I got SSE working on a sync command by just adding ‘ —add-header=x-amz-server-side-encryption:AES256’ to the command line. There is probably a better way but that was pretty simple for me.

    (15 October 2011, 04:39 · #)

  146. Ed wrote:

    I’m wondering if anyone has any luck installing this on CentOS 7. I tried it by using the RHEL_6 repo and I’m gettting the following error when trying to —configure:

    Problem: ImportErr: No module named S3.Exceptions
    S3cmd: unknown version. Module import problem?

    Traceback (most recent call last): File “/usr/bin/s3cmd”, line 1995, in ? from S3.Exceptions import *
    ImportError: No module named S3.Exceptions

    (24 October 2011, 07:09 · #)

  147. fmp wrote:

    s3cmd mb s3://bucket/subdir

    - how can i proper allocate the country where i would like to land data files? Let’s say Tokyo?

    (28 October 2011, 17:31 · #)

  148. Earnest wrote:

    What’s the best possible way to automate the removal of files with after so many days.

    Everyday there is a mysqldump performed. I then tar/gzip up the two dump files into one and push up to s3. Is there a way to only keep a weeks worth in s3? I am not storing any of the dump files on the server. I’m using the tool ‘s3cmd’ Thanks in advance!!!

    (15 November 2011, 05:55 · #)

  149. Scott wrote:

    Please make this package available via easy_install/pip. There’s no reason not to and it makes it way easier to deal with that way. Being easy to install helps drive adoption.

    (15 November 2011, 06:16 · #)

  150. John Conneely wrote:

    Regarding people looking for an equivalent windows tool, I just found https://s3.codeplex.com/. I’ve only used it for a few hours, but so far it works great.

    BTW — Thanks for providing s3cmd! I use it extensively on my linux hosts.

    ( 6 December 2011, 10:52 · #)

  151. Mike M wrote:

    Just got this from Amazon:

    We are excited to announce Multi-Object Delete, a new Amazon S3 feature that allows you to delete multiple objects with a single request. With this feature, you can remove large numbers of objects from Amazon S3 more quickly than using multiple individual DELETE requests.

    Will/does s3cmd support this?

    ( 9 December 2011, 06:13 · #)

  152. Moritz wrote:

    Hi,
    awesome tool. My uploaded folders even appear in the AWS Management Console. Incredible!

    In my home directory (Ubuntu) I can easily open the .s3cfg file with all the security-sensitive information.
    Is there a standard way to protect this information?
    Maybe you want to add a sentence to the description on how to deal with the .s3cfg file.

    Thanks a lot,
    Moritz

    (27 December 2011, 23:40 · #)

  153. Ruben Cardenal wrote:

    Nice program. But it should use exit codes to be used with $?

    Regards.

    (13 January 2012, 01:37 · #)

  154. H Semage wrote:

    I’ve been using s3cmd for duplicating an s3 bucket to another bucket, but I ran into a problem when I tried duplicating a bucket with over a million files in it. After typing s3cmd cp -r […] it hangs for a few minutes and just dies. I’m assuming there are too many files in the list and it can’t handle them. Do you have any ideas on how I could make it work? I know that the old s3sync tool had a limiting system where it copied 1000 files at a time and then fetched the next page of files from the list. Is this possible with s3cmd?

    (15 January 2012, 22:35 · #)

  155. HanJingYu wrote:

    If size of local file is greater than 15MB,

    s3cmd put local_file s3://bucket/remote_file >/dev/null

    does not work, but the

    s3cmd put local_file s3://bucket/remote_file

    works.

    (17 January 2012, 03:02 · #)

  156. keith wrote:

    Is it possible to when uploading a file to add read permissions for Authenticated Users? I tried the following but it does not add the read permission. Looking at the help I see —acl-grant grants permission for a user and is not for the actual file. Is there a way to do it for a particular file?

    ./s3cmd put —encrypt —check-md5 —add-header=x-amz-server-side-encryption:AES256 —reduced-redundancy —acl-grant=read:AuthenticatedUsers —mime-type=video/mp4 ~/Desktop/test.mp4 s3://BUCKET

    (24 January 2012, 11:09 · #)

  157. NearlyNubile wrote:

    Hi. Thanks for this lovely tool.

    Could you please make “speedup” a part of the core. Why should it be separate?

    Secondly, is there any smart way to automatically delete files in the S3 bucket older than a certain date?

    Thanks!

    (26 February 2012, 00:42 · #)

  158. Jeff wrote:

    Hi!

    The date/timestamp seems to be not reliable. when using s3cmd to sync a file, I can have the file copied on 01/01/1969 or at the current date.

    I would actually like the date to be the original date of the file.

    Is there a solution to this? Because I tried many ways, with s3fs, s3cmd sync or rsync, and it seems there is no way to get the good time (original time) on Linux with S3.

    Do someone has an idea on this problem?
    Thanks.

    (14 March 2012, 03:35 · #)

  159. Ant wrote:

    It doesn’t seem that s3cmd supports ls with wildcards – unless I missed something.

    I have some really large buckets and it would be hugely useful to be able to list files matching a pattern rather than retrieving all file names.

    s3cmd info with wildcards would also be really useful.

    (15 March 2012, 06:11 · #)

  160. Ant wrote:

    p.s. thanks for a super tool

    (15 March 2012, 06:13 · #)

  161. LeeRoy wrote:

    Hi Guys, just to update you, finally I found a way to solve it
    Do you have error messages?, like :

    * Path too long * Error cannot delete file: cannot read from source file or disk * Cannot delete file: Access is denied * There has been a sharing violation. * Cannot delete file or folder The file name you specified is not valid or too long. Specify a different file name.

    For that I tried it with: http://longpathtool.com/

    (16 March 2012, 05:26 · #)

  162. Greg wrote:

    Is there a way to only grab the latest dated file? I have a list of hundreds, but I want to just grab the most recent one.

    (19 March 2012, 09:27 · #)

  163. EP wrote:

    I’m having problems uploading a 23MB file with the s3cmd. The error returned is: failed (32, ‘Broken pipe’)

    I’ve success uploaded a 35kb file.

    Do you have any solution for this?

    thanks.

    (20 March 2012, 03:13 · #)

  164. EP wrote:

    SOLUTION: I’ve download the version 1.0.1 and the problem is fixed.
    Thanks

    (20 March 2012, 03:23 · #)

  165. Kenneth Nielsen wrote:

    Hey all. Thanks for the programs.

    The link to the encryption howto is broken, has it been moved?

    (27 March 2012, 00:00 · #)

  166. Paul Brewer wrote:

    Because of the issue below, I’d like to put in a feature request for optionally encypted configfiles:

    Issue: An attacker who has gained access to the .s3cfg file in a user’s home directory can obtain that user’s s3 access keys and delete or access all of that users s3 files.

    Requested Feature:

    0. detect whether “gpg” runs gnu privacy guard

    1. If GPG is available, then in the configuration prompts s3cmd —configure, ask “Would you like the .s3cfg configuration file to use symmetric encryption. Saying yes encrypts the configuration textfile with a passphrase, preventing use of s3cmd without the passphrase. Saying No will leave the configuration information in clear text, but makes batch/scripting operations easier [y/n]?

    2. If yes, ask for a passphrase and run the configuration plaintext through gpg —symmertric and direct the output to .s3cfg

    3. When reading the configuration file .s3cfg, if the file is not in plaintext, emit “passphrase required”, and run gpg —symmertric to decrypt. If decryption fails, tell the user. If it succeeds, read the
    decrypted plaintext configuration and do the operation

    If somehow, this feature already exists, or can be easily thrown together, I’d be pleasantly surprised. If not, I think it could be a useful addition.

    Thanks for reading

    Paul

    (30 April 2012, 17:37 · #)

  167. Paul Brewer wrote:

    Here’s a workaround to secure the .s3cfg file with shell scripts.

    These assume you have gpg installed, and that you, or your scripts, run s3cmd under human direction. The goal is to be able to manually lock the config details away so that an attacker can not simply read .s3cfg and delete or steal your s3 file collection while you are away — but at the same time make it fairly easy to restore the clear text s3 configuration when you come back to resume working.

    Create file “s3lock” containing

    #!/bin/bash
    umask 077
    gpg —symmertric </.s3cfg >/.gpgs3

    Create file “s3on” containing

    #!/bin/bash
    umask 077
    gpg —decrypt /.gpgs3 >/.s3cfg 2>/dev/null

    Create file “s3off” containing

    #!/bin/bash
    rm -f ~/.s3cfg

    Note: There should be a squiggle to indicate the home directory on all of the dot file names. I think the blog editor is editing this out. Make sure to put it in.

    Put these someplace useful, like /usr/local/bin, and chmod 755 so they will be executable.

    after setting up s3cmd with s3cmd —configure, run “s3lock” and it will ask you
    for a passphrase. Check to make sure it created its fie with “ls ~/.gpgs3”. Now run s3off and try an s3cmd, like s3cmd ls. Should not work, missing config file. Now run s3on and enter the passphrase. This will restore your cleartext config file. s3cmd ls should now work. When done with s3cmd, run s3off to remote the config file again.

    It might be useful to put “s3off” in the .bash_logout file to keep you from forgetting.

    (30 April 2012, 20:08 · #)

  168. Richard D. LeCour wrote:

    (Needed this for accessing S3 from EC2.)

    Hint: As an alternative to adding HOME=/root or adding —config=/some/where/.s3cfg, you can also add a symbolic link in /root/:

    # cd /tmp/ # sudo ln -s /home/ec2-user/.s3cfg # sudo mv /tmp/.s3cfg /root/.s3cfg

    Worked for my needs. Thanks for this toolset!

    (17 May 2012, 17:43 · #)

  169. Gavin wrote:

    I’ve installed the s3cmd from your ubuntu repository, which gives version 1.0.0

    When i try and upload from an EC2 instance to an s3 bucket created by S3cmd, i get ([Errno 32] Broken pipe) which then tries to slow down the connection. I’ve tried manually setting the throttle really low (editing s3.py as mentioned somewhere above), but to no avail.

    ubuntu 10.04
    python 2.6.5

    any ideas for resolving?

    ( 2 July 2012, 10:00 · #)

  170. Brian wrote:

    Gavin,

    Make sure your time is synced correctly with a NTP server, like pool.ntp.org. If its even 5 minutes or so off, I have seen it do this. Once synced, it will work fine. Give it a try.

    ( 4 July 2012, 05:33 · #)

  171. Matt wrote:

    Couldn’t be happier with this tool; super easy to setup and use (OSX 10.7). Automated my S3 deployment in minutes.

    You guys rock!

    (12 July 2012, 13:50 · #)

  172. Jan wrote:

    Great tool! I would love to see a way to preserve timestamps on the file during upload and download.

    ( 7 August 2012, 21:41 · #)

  173. Mithun wrote:

    How to pass the variable to s3cmd put command? I’m trying to use this command in a script as below:

    s3cmd put ${upload_path} s3://${upload_dest}

    where
    upload_path=/home/eng/test.file
    upload_dest=mybucket/

    With the above command in script, the file is not getting uploaded. Please help!!!

    (10 August 2012, 09:16 · #)

  174. Chris wrote:

    @Mithun

    I did the following without issue:

    upload_path=/home/eng/test.file
    upload_dest=“s3://mybucket”

    s3cmd put $upload_path $upload_dest

    (12 August 2012, 17:54 · #)

  175. richard wrote:

    Please add —acl-authorized for read access for authorized users in the setacl. Thanks.

    (24 August 2012, 07:28 · #)

  176. GunaSeelan wrote:

    Excellent tool, how to unconfigure the bucket details?

    Removal of .s3cfg is one way i can think of, let me know if there is a proper way to unconfigure all the bucket details provided to s3cmd.

    ( 5 September 2012, 00:53 · #)

  177. Catherine wrote:

    Is there any way to do s3cmd configuration without user interaction such as passing in a predefined s3cfg?

    (27 September 2012, 18:59 · #)

  178. Suraj Nayak wrote:

    Hi Guys,

    is s3cmd checks data integrity while uploading on s3. I mean I wanted to upload data on s3 and need to make sure that all data uploaded on s3 is perfect.

    I don’t want to query again on s3 for each object to match size.

    (15 October 2012, 23:59 · #)

  179. Andrei wrote:

    Dear Michal,

    Thank you for a very useful tool you’ve created.

    In this guestbook, I can see several questions about bandwidth throttling. Did I understand it correctly that bandwidth throttling is not possible with the current version of s3cmd?

    Best regards,
    Andrei.

    (25 October 2012, 06:08 · #)

  180. Michael Kors On Sale wrote:

    if not with go, seem to be me to have <a href=“http://www.michaelkorsoutletco.com/”>http://www.michaelkorsoutletco.com/</a> no too much.The Yuan minister isn’t originally <a href=“http://www.michaelkorsoutletco.com/michael-kors-crossbody-c-96.html”>Michael Kors Crossbody</a> small to my opinion, I don’t hope because this matter make him larger to my viewpoint.” The east easily sighed tone, Xie Wen Dong’s <a href=“http://www.michaelkorsoutletco.com/michael-kors-clutches-c-104.html”>Michael Kors Clutches</a> words were reasonable, and just Yuan China didn’t see Xie Wen Dong, denouncing openly him is a chicken heart.He the wry smile is <a href=“http://www.michaelkorsoutletco.com/michael-kors-hamilton-c-98.html”>Michael Kors Hamilton</a> 1, say:“Is all right!“Immediately, he tells Xie Wen Dong the address of he’s place. Thank a text east to stick down the address and tell to the gold eye, then say:“The full speed opens over there!”

    ( 1 November 2012, 21:39 · #)

  181. Jay Santos wrote:

    Hi,

    I used s3cmd to backup large files on my server. I split large files greater than 5GB. My question is, Is there a command to merge split files in a bucket using s3cmd? (e.g s3cmd cat file* > file.tar.gz)

    Thank you,
    Jay

    ( 2 November 2012, 16:27 · #)

  182. Steve Kessler wrote:

    Is there a way to create a new folder using s3cmd? I want to write a script that will create a new folder on Amazon.

    Thanks,
    Steve

    ( 5 November 2012, 17:53 · #)

  183. peep wrote:

    storage.jpg is not available for the public :(

    (11 November 2012, 00:38 · #)

  184. puspharaj wrote:

    Here is the issue with s3cmd 1.1.0 beta 3

    I use script to sync my folder to S3

    WARNING: Module python-magic is not available. Guessing MIME types based on file extensions.

    WARNING: Module python-magic is not available. Guessing MIME types based on file extensions.

    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! An unexpected error has occurred. Please report the following lines to: s3tools-bugs@lists.sourceforge.net
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    Problem: KeyError: ‘elapsed’
    S3cmd: 1.1.0-beta3

    Traceback (most recent call last): File “/usr/bin/s3cmd”, line 2006, in <module> main() File “/usr/bin/s3cmd”, line 1950, in main cmd_func(args) File “/usr/bin/s3cmd”, line 1211, in cmd_sync return cmd_sync_local2remote(args) File “/usr/bin/s3cmd”, line 1190, in cmd_sync_local2remote (item[‘full_name_unicode’], uri, response[“size”], response[“elapsed”],
    KeyError: ‘elapsed’

    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! An unexpected error has occurred. Please report the above lines to: s3tools-bugs@lists.sourceforge.net
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    You have new mail in /var/spool/mail/root

    What is going on?

    (12 November 2012, 01:13 · #)

  185. puspharaj wrote:

    Here is the patch for the above issue sad to know that its not fixed in 1.1.0 beta 3

    replace the whole file under /usr/lib/python2.6/site-packages/S3/S3.py with under this file don’t replace the exact line insteatd of that replace whole file by View file tab at the right side.

    https://github.com/s3tools/s3cmd/commit/9c57a3ba2163915deb2cc63cefa885a66ac377ab

    Thanks

    (12 November 2012, 18:31 · #)

  186. Keith wrote:

    This page should be updated so it is more usable. There are a lot of good questions and comments on here but difficult to put it all in context.

    (16 November 2012, 06:44 · #)

  187. tiger wrote:

    I’d like to batch encrypt large set of files before sending them to AWS Import/Export. I hope I can extract them with s3cmd without doing decryption.

    I tried with one (gzipped) file; encrypted the file and ran “s3cmd put —no-encrypt” to put the enconrypted file into S3; then ran “s3cmd get”; but the file got back from s3 was not decrypted. Did I miss something?

    Thanks,
    tiger

    (29 November 2012, 09:54 · #)

  188. Mulberry Handbags wrote:

    Like most people match chic nappy bags in the street, this does Storksak baby diaper bag serves up a number http://www.mulberryhandbagsoutlet.net/ of traits companies except for usefulness. The interior paving is quite supposed additionally it leftovers relaxing what to super romantic similar perfect stuffs frosty.

    (13 December 2012, 23:22 · #)

  189. Joe wrote:

    Are we ever going to get directions on removing s3cmd?

    My local installation was broken recently and can not find python:

    zsh: /usr/local/bin/s3cmd: bad interpreter: /usr/local/bin/python: no such file or directory

    I’m not really advanced enough to start poking around and changing things, so a fresh install of s3cmd would be something I’d like to try.

    Unfortunately, I can’t find any resource on the Internet that helps show how to do that.

    ( 3 January 2013, 04:36 · #)

  190. Jon wrote:

    This tool has to be one of the greatest tools ever built. Simple yet powerful, it has redefined my career and priorities.

    I’ve been dealing with data for 16 years, and this one little tool has changed everything.

    I’m speechless with gratitude. Thank you, thank you, thank you.

    jw

    PS: Suggestion: Sort these comments so the most recent is at the top!!

    (22 January 2013, 15:27 · #)

  191. Marco wrote:

    Hi – do you plan to implement a “regional switch” for controlling the region where the bucket will be created? (as asked in comment #79)
    Thanks for the amazing tool, btw.

    Marco

    (18 February 2013, 00:10 · #)

  192. WLD wrote:

    On the subject of securing the .s3cfg from prying eyes, this is what I have impleted to protect just my GPG passphrase. There’s no reason it can’t be extended to protect the entire .s3cfg file but I see that as a little pointless TBH.

    1) MAKE A BACKUP OF YOUR .s3cfg FILE! If something goes wrong and you lose your config file or passphrase and can never decrypt your uploaded files again it is entirely YOUR own fault for not taking a backup before you start changing things.

    2) As root, create a mountpoint for a ramfs. You can create this anywhere you like, just make sure you change the locations below to match # mkdir -p /mnt/fake/s3cfg

    3) As root, add this to your /etc/fstab file somewhere after your swap and /proc are specified
    s3cfg /mnt/fake/s3cfg ramfs rw 0 0

    4) As you, extract your s3cmd plaintext password and save it in its own file encrypted. You will be prompted for a passphrase; you can of course use the same passphrase you have configured to use for s3cmd already but if you have a keylogger on your machine this would be bad as it reveals the end secret
    $ grep gpg_passphrase ~/.s3cfg|sed ‘s/^.*= //’|gpg -c -o ~/.s3cfg-pass

    5) As root, create this little script as /usr/local/bin/s3unlock #!/bin/bash
    echo “Temporarily decrypting your passphrase to enable s3cmd GPG functions…”
    outfile=/mnt/fake/s3cfg/`whoami|md5sum|cut -b -32`.s3cfg-plain
    if [ -e $outfile ]; then rm -f $outfile;
    fi
    umask 0277
    gpg -d —yes -o $outfile ~/.s3cfg-pass 2>/dev/null
    if [ $? -eq 0 ]; then echo “Passphrase decrypted – s3cmd will work”
    else echo “There was a problem decrypting the passphrase – s3cmd will NOT work right now”
    fi
    echo

    6) As root, ensure the new script is secure and executable # chown root.root /usr/local/bin/s3unlock; chmod 0755 /usr/local/bin/s3unlock

    7) As you, change your .s3cfg file, replace the line that starts with gpg_passphrase so it looks like this
    gpg_passphrase = `cat /mnt/fake/s3cfg/$(whoami|md5sum|cut -b -32).s3cfg-plain`

    8) As root, add this to your startup scripts, somewhere in /etc/rc.d/ like maybe at the end of /etc/rc.d/rc.S or equivalent
    chmod 0773 /mnt/fake/s3cfg/

    That’s all!

    To use, you should first restart your computer to get the ramdisk come up then login to your account as normal. In a console just run s3unlock and enter the passphrase you typed. Then you can use s3cmd as you always have until you either restart the computer or call s3unlock again and don’t enter a passphrase.

    NOTES: Unfortunately step 8 is required as mount ignores most options for ramfs :( However the chmod is what enables all users to write to the ramdisk and mode 0773 hinders other users from snooping around the ramdisk contents unless they know the existing filename. The plaintext files use the MD5 of your username just to make it a bit more complicated for someone to guess and so any found plaintext filename can’t be immediatly known its yours (I bet you were wondeing why I did that).

    DO NOT use this on a system with users you don’t trust. It’s not entirely secure! However if it’s just you or friends who you trust then this appoach works well. The approach uses ramfs NOT tmpfs, otherwise your plaintext passphrase could be extracted from on-disk swap partition if the machine was just powered off! ramfs never goes in to swap. But there are dangers that malicious/stupid users could fill your ramfs fully and lock the machine. Try not to do that. As you can expect, root will be able to discover all passphrases once you’ve decrypted them.

    By holding the only copy of the plaintext passphrase in RAM, all you need to do is shutdown the computer to get rid of it, whether properly or you can flick the power switch off in a hurry. Calling s3unlock again will also wipe the plaintext until you enter the passphrase again.

    Good luck!

    (24 February 2013, 21:30 · #)

  193. WLD wrote:

    My last post wasn’t formatted properly, so I have uploaded the same to Pastebin
    http://pastebin.com/dQkWmBrb

    (24 February 2013, 21:35 · #)

  194. Paul Thomson wrote:

    I would love to see a feature to enable bandwidth throttling as outlined by many people above…

    Thanks,
    Paul :-)

    (26 February 2013, 22:19 · #)

  195. Giona wrote:

    Hi Michal,

    First of all, s3cmd rocks. Thank you so much. I’d like to give a suggestion for future releases. I’m having troubles when syncing some log files while they’re in use. Of course they are often modified during the upload so, after completing, s3cmd complains that “MD5 Sums don’t match!” and retries the upload. For very large log files this means a lot of wasted time. I think that could be useful (and trivial to implement) to be able to dinamically set _max_retries (in /usr/share/s3cmd/S3/S3.py) to a value lower than the hardcoded “5”, maybe using a parameter in the .s3cfg file and/or in the command line.

    G

    (27 February 2013, 06:06 · #)

  196. m wrote:

    I downloaded the latest tar , unzipped it and ran the python install command suggested in the install file …. it looked like it installed ok but now when i run s3cmd i get File “/usr/bin/s3cmd”, line 28, in ? import S3.Exceptions File “/usr/lib/python2.4/site-packages/S3/Exceptions.py”, line 6, in ? from Utils import getTreeFromXml, unicodise, deunicodise File “/usr/lib/python2.4/site-packages/S3/Utils.py”, line 172 utc_dt = datetime.datetime(*dateS3toPython(s3timestamp)[0:6], tzinfo=pytz.timezone(‘UTC’)) ^
    SyntaxError: invalid syntax

    It worked before the new install…. what do i do?

    ( 9 March 2013, 19:08 · #)

  197. Revanth wrote:

    Hi all,
    1. I have installed s3cmd tool under the guidance of following link: http://survivalguides.wordpress.com/2012/04/02/installing-s3cmd-on-amazon-server/.
    2. Then I tried configure settings as follows: s3cmd —configure

    error: Instead of asking for Access key and Secret key , I am getting following ERROR:


    Enter new values or accept defaults in brackets with Enter.
    Refer to user manual for detailed description of all options.

    Access key and Secret key are your identifiers for Amazon S3
    Access Key:
    Configuration aborted. Changes were NOT saved.

    Please help on this.

    Thanks in advance,
    Revanth

    (12 March 2013, 04:11 · #)

  198. Brad wrote:

    I can’t find the speedup branch anymore. Does it still exist? I need to speed up my transfers as much as possible!

    Brad

    (13 April 2013, 11:44 · #)

  199. berv wrote:

    I have installed s3cmd on an existing unix system using sudo apt-get install s3cmd and i cannot locate the .s3cfg file. any pointers?

    (24 April 2013, 08:39 · #)

  200. Glen wrote:

    Hi Michal,

    s3cmd is the bomb!

    I’d like to dump ZFS streams, any chance of adding a —filename or —destURL switch with a “filename on other end” argument and capturing stdin?

    Glen

    (22 May 2013, 07:01 · #)

  201. kumar wrote:

    Hi ,

    I ran this command and i expected to see a file with the path that i mentioned.

    s3cmd put /tmp/mr1.spec s3://qwertyasdfg/14192013/

    but when i do

    s3cmd ls s3://qwertyasdfg … i dont see the file created under s3cmd ls s3://qwertyasdfg.

    am i missing anything here ?

    (23 May 2013, 10:28 · #)

  202. kumar wrote:

    please ignore my previous comment. Its working .

    s3cmd put /tmp/mr1.spec s3://qwertyasdfg/14192013/

    Thanks you for the nice tool.

    (23 May 2013, 10:31 · #)

  203. johan wrote:

    Hi,
    I’m running incremental backups of a photo collection on my NAS with s3cmd, but I have issues with folder names.

    A folder that is supposed to be named “kameratömning” is renamed into “kamerat��mning” when it is uploaded to S3. It seems like the issue is with the Swedish characters “åäö”/“ÅÄÖ”. Is there any way to fix this?

    When s3cmd gets as far as a actually uploading the files, it’s pretty fast, but before uploading s3cmd takes hours and hours to unicodise all my files, like this for a few 10 000s of files:
    DEBUG: Unicodising ’2013/Mobile Android/20130316_135925.jpg’ using ASCII
    DEBUG: Unicodising ‘/mnt/HD/HD_b2/DIGITALFOTON/2013/Mobile Android/20130316_135925.jpg’ using ASCII
    DEBUG: Unicodising ’2013/Mobile Android/20130327_112635.jpg’ using ASCII
    DEBUG: Unicodising ‘/mnt/HD/HD_b2/DIGITALFOTON/2013/Mobile Android/20130327_112635.jpg’ using ASCII

    This is the same issue as reported here: http://sourceforge.net/p/s3tools/discussion/618865/thread/a7924400/

    Is there any known solution for this issue where unicodising takes forever? (and still ends up incorrectly naming folders)

    I am using s3cmd-1.5.0-alpha3, running on a DNS-320 NAS with fun_plug 0.7.

    Many thanks for a useful tool!

    (14 June 2013, 21:07 · #)

 
---