#17 s3cmd should return non-zero exit status on errors

Enhancement_request
closed-invalid
nobody
s3cmd (118)
5
2008-11-11
2008-08-25
Anonymous
No

It would be great if s3cmd and s3sync returned non-zero exit codes on failures, for scripting....

[root@domU-12-31-39-00-55-21:~] s3cmd get some-bucket:non-existant-key local
S3 command failed:
get_stream some-bucket non-existant-key #<File:0xb7846810>
With result 404 Not Found
[root@domU-12-31-39-00-55-21:~] echo $?
0

[root@domU-12-31-39-00-55-21:~] s3sync some-bucket:DONOTEXIST /tmp
[root@domU-12-31-39-00-55-21:~] echo $?
0

also, if you don't have your keys set, also no error return:

[root@domU-12-31-39-00-55-21:~] unset AWS_ACCESS_KEY_ID
[root@domU-12-31-39-00-55-21:~] s3cmd get some-bucket:file a
You didn't set up your environment variables; see README.txt
s3cmd [options] <command> [arg(s)] version 1.0.6
--help -h --verbose -v --dryrun -n
--ssl -s --debug -d --progress

Commands:
s3cmd listbuckets [headers]
s3cmd createbucket|deletebucket <bucket> [headers]
s3cmd list <bucket>[:prefix] [max/page] [delimiter] [headers]
s3cmd delete <bucket>:key [headers]
s3cmd deleteall <bucket>[:prefix] [headers]
s3cmd get|put <bucket>:key <file> [headers]
[root@domU-12-31-39-00-55-21:~] echo $?
0

Discussion

  • Michal Ludvig
    Michal Ludvig
    2008-11-11

    I'm afraid this is some other s3cmd than the one from this project. Our s3cmd returns proper exit code as far as I can tell and takes different parameters. Please check the website of your s3cmd or (better) switch over to using our s3cmd instead ;-)

    Have a look at http://s3cmd.org for details.

     
  • Michal Ludvig
    Michal Ludvig
    2008-11-11

    • status: open --> closed-invalid