I am trying to get a handle on how to pipe from a command into something like gzip, cpio or tar.
The commands in question belong to the ZFS system. I am running ZFS on Ubuntu Linux 10.04.3.
The commands I working with are;
To create a snapshot; zfs snapshot media/mypictures@20070607 To copy the snapshot to a directory; zfs send media/mypictures@20070607 > ~/backups/20070607 Then I can also pipe into gzip zfs send media/mypictures@20070607 | gzip > ~/backups/20070607.gz
These parts I understand.
But my first question is, what would I do to pipe into tar + gzip?
zfs send media/mypictures@20070607 | tar czvf > ~/backups/20070607.tar.gz
And my other question is how would I get the data out of the tarball or gzip?
I have to use
zfs recieve media/mypictures@20070607 < ~/backups/20070607
So would it just be this if I was using tar?
zfs recieve media/mypictures@20070607 | tar xzvf < ~/backups/20070607.tar.gz