I currently use s3cmd to sync backups from our servers to amazon s3. I do this using a cron similar to the following:
[email protected]
01 03 * * * s3cmd sync /root/backup/backups/ s3://somebucket/
This is just a sample, the files to be synced are already in the backups directory. Currently when I use this, I quite often get warnings about the upload fails (connect reset by peer) and then the retries. After 1 or 2 retries the upload generally gets there.
What I'd like to know is can I change the verbosity of s3cmd to only log output when it actually errors, rather than warns so that I only get emailed when I need to look at something?
It appears you might be able to set this in the .s3cmd preference file, but I wanted to make sure.
Thanks
If you have a newer version of s3cmd
, try the --quiet
(or -q
) option:
[email protected]
01 03 * * * s3cmd sync --quiet /root/backup/backups/ s3://somebucket/
If not, just redirect STDOUT
to /dev/null
like so:
[email protected]
01 03 * * * s3cmd sync /root/backup/backups/ s3://somebucket/ >/dev/null
Errors are sent to STDERR
so they will still be emailed out.
UPDATE ABOUT S3CMD and STDERR:
As Valguss pointed out, it seems that s3cmd always logs debug, info, warning and error messages to STDERR
so the above methods will not work.
However, the verbosity level can be controlled from the .s3cfg
file (located in the home directory for the user associated with the cron job in this case):
[default]
verbosity = ERROR
A verbosity level of ERROR
can not be configured via command line parameters at this time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With