I cannot seem to get the --exclude-from= option to work with my exclude GLOB file when synchronizing with my s3 bucket. Here is a trivial example to demonstrate:

I create the following file tree under my /home/user:


The contents of my exclude-list.txt:


Then I use the following s3cmd command, called under /home/user:

[lucas@lucas-ThinkPad-W520]~$ s3cmd sync --exclude-from=syncTest/exclude-list.txt syncTest s3://my.bucket/lucas/

but my excludeTest directory is not excluded:

[lucas@lucas-ThinkPad-W520]~$ s3cmd ls s3://lucas.backup/lucas/syncTest/
                   DIR   s3://lucas.backup/lucas/syncTest/excludeTest/
                   DIR   s3://lucas.backup/lucas/syncTest/includeTest/
2014-04-06 12:18        21   s3://lucas.backup/lucas/syncTest/exclude-list.txt

I also tried using the following contents for my exclude-list.txt file:


But it does not work either.

Any suggestions? In this example, I just want to sync my syncTest folder, but not the excludeTest subfolder, using a file with the --exclude-from=FILE option.

I am trying to follow the same format as rsync's --exclude-from=FILE option, assuming that it is the same, because there is not much help for s3cmd.


Though it is not the best answer, I found something that works by adding the following to my exclude-list.txt file:


I found the answer here:


It is not intuitive, and I think it is a bug. I do not think that rsync has this problem, and it is probably specific to s3cmd. Very annoying!

I am interested in hearing more about this problem.

Are there better options for backing up to S3 using rsync or a similar tool? Is there a better solution than/when using the --exclude-from=FILE option?

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.