Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to use s3cmd to copy a full bucket down to my local machine like so:

s3cmd -c .s3cfg-bespoke sync s3://my_bucket/ ~/local_folder/

There are three folders and a smattering of files in the bucket. The first folder and it's contents are copied without issue, but the second folder throws an error before anything is transferred:

Problem: OSError: [Errno 21] Is a directory: '/home/me/local_folder/images/'
S3cmd:   0.9.9.91

Traceback (most recent call last):
  File "/usr/bin/s3cmd", line 1736, in <module>
    main()
  File "/usr/bin/s3cmd", line 1681, in main
    cmd_func(args)
  File "/usr/bin/s3cmd", line 1070, in cmd_sync
    return cmd_sync_remote2local(args)
  File "/usr/bin/s3cmd", line 889, in cmd_sync_remote2local
    raise e
OSError: [Errno 21] Is a directory: '/home/me/local_folder/images/'

I've tried using the --recursive switch but it doesn't affect the outcome. I've been through the manpage and no other options seem like they would help.

Am I doing something wrong in the command? Or have I stumbled across a genuine bug?

share|improve this question
up vote 3 down vote accepted

From Amazon aws forum:

s3cmd -c .s3cfg-bespoke --rexclude "/$" sync s3://my_bucket/ ~/local_folder/
share|improve this answer
    
--rexclude "/$" – Ryu_hayabusa Oct 7 '14 at 17:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .