Server Fault is a question and answer site for system and network administrators. 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

Is there a tool that makes possible to backup a Mysql database to Amazon S3 or Amazon Glacier without having o create a local file with the database contents?

Something like that:

mysqldump -u root -ppass -h host --all-databases | magical-s3-tool s3-bucket backup-yyyy-mm-dd.sql

This magical tool would use the pipe data and transfer the backup data directly to S3, without creating a local file.


My goal is to avoid having to use a VM with a huge disk for running the backup process.

share|improve this question
You could probably stream it into an S3FS mountpoint. – ceejayoz Dec 18 '12 at 20:15
Why are you trying to avoid the creation of a file? The answer to this might help frame the recommended approach. – Eric Hammond Dec 18 '12 at 20:48
I am not sure about S3 but you can often pipe over SSH like this: mysqldump | ssh remote-box "cat > file.sql" – jeffatrackaid Dec 18 '12 at 21:13
@Eric Hammond yes, i'm trying to avoid the creation of a file – Rubem Azenha Dec 18 '12 at 21:24
@RubemAzenha: Yes, that's clear... but why? (performance, security, regulations, size, disk space, for the fun of it, ...?) If you can explain what your underlying goals are, that can lead to a better answer that meets those goals. You can simply update the question above with your criteria, philosophies, and driving constraints. – Eric Hammond Dec 19 '12 at 22:58

There is a tool which can do this (Amazon Glacier only). See --stdin option in documentation.

Note that this operation will block your mysqldump (if network is bottleneck), and this can cause problems with mysql lockings etc.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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