This is the command I use to tar my backup files, write to stdout and then upload everything to Amazon S3 with an email notification.
tar -czvf - --exclude-caches /var/www | s3cmd --reduced-redundancy --multipart-chunk-size-mb=30 put - s3://MY-BUCKET/`date +\%G-\%m-\%d`.tar.gz | mail -s "Weekly Backup"
Everything works fine except the mail
command. I think I have some syntax error.. as I get:
mail: Cannot parse address `File '-' stored as 's3://MY-BUCKET/2014-08-31.tar.gz' (0 bytes in 2190.3 seconds' (while expanding `File '-' stored as 's3://MY-BUCKET/2014-08-31.tar.gz' (0 bytes in 2190.3 seconds'): Malformed email address
mail: Cannot parse address `-1.00 B/s) [1 of 1]' (while expanding `-1.00 B/s) [1 of 1]'): Malformed email address
root:~# tar -czvf - --exclude-caches /var/www | s3cmd --reduced-redundancy --multipart-chunk-size-mb=30 put - s3://MY-BUCKET/`date +\%G-\%m-\%d`.tar.gz
| mail -s "Weekly Backup"