Re: Pipe to tar or other compressor
Steve Holdoway <[email protected]>
| Newsgroups | gmane.org.user-groups.linux.new-zealand.general |
|---|---|
| Organization | Green Gecko Global Ltd. |
| Message-ID | <1318795598.28735.11.camel@steve-desktop> |
On Mon, 2011-10-17 at 07:47 +1300, Daniel Lawson wrote:
> > mysqldump {opts} | tar -cf --lzma - > outfile.7z
> >
> > doesnt work because tar expects a directory
> >
> > two steps works for the last method , but this is linux it must be
> > doable in one step?
>
> tar --lzma -cf - <(mysq;dump ${opts} ) > outfile.7z
>
>
> This opens up a named pipe, with the output of mysqldump being piped
> through it. tar sees this as a filedescriptor it can open.
<slightly irrelevant>
In my experience, performing these two operations concurrently can place
an unacceptably large load on a production server, as well as locking up
the database ( if you're taking a snapshot ) far longer than absolutely
necessary.
The only time I do this as a single operation is if I'm really short on
disk space.
</irrelevance>
Steve
--
Steve Holdoway BSc(Hons) MNZCS <[email protected]>
http://www.greengecko.co.nz
MSN: [email protected]
Skype: sholdowa
_______________________________________________
NZLUG mailing list [email protected]
http://www.linux.net.nz/cgi-bin/mailman/listinfo/nzlug