I'm going to tell you exactly what I need in order to clarify the cryptic question in the title. I'm currently making scheduled MySQL backups of all my databases with something like:mysqldump ... | gzip -c > mysql-backup.gzThis is ok, but I'm willing to make a separate file for each single database, since that will make it easier to take a look at dumped data or restore a single database:for db in $dbs; do mysqldump ... $db | gzip -c > mysql-backup-$db.gz; doneI'd like to store all of the dumps for each single backup in a single .tar file, i.e. mysql-backup.tar.gz with all the dumped databases inside. I know I can simply leave .sql files uncompressed and then tar -cz *.sql, but 1) I'm searching for a way that doesn't need to temporarly store big files. In my current script, in fact, mysqldump is piped into gzip, so no big file is created. 2) Is there a similar way in which I can create .tar.gz from stdin? 3) Is tar -c *.sql.gz eqivalent to tar -cz *.sql?
Is it possible to make a .tar.gz file directly from stdin? Or, I need to tar together already gzipped files
tar;compression;gzip