[SWLUG] Network backups

Chris M. Jackson chriscf at gmail.com
Tue Sep 12 16:37:12 UTC 2006


On 9/12/06, Glenn Booth <d.glenn.booth at gmail.com> wrote:
> First, what on earth does the " - " mean in the tar command "tar -zcf -
> /home..." (the
> second hyphen). The tar 'info' and 'man' pages didn't show me anything, and
> Googling for "tar -" isn't very productive.

The "-" is not a flag for tar, but an argument for "-f", which refers
to the file that tar is to work with (the one it is to create,
extract, etc.).  In common with many tools, specifying the filename as
"-" means to write to the standard output instead of a physical file.
In this case, it is the input to "cat" on the remote machine.  Be
warned that lots of programs let you do this, but others will just
create a file called "-".

> Second (and this shows my lack of understanding) how would I restore a tar
>  file created this way? i.e. can it be used in reverse?

Though there are probably many arcane ways of doing this, the simplest
would be to just grab the file from the remote site (via your
favourite transfer method - ftp, sftp, scp, etc.) and extract the
files you need from it as usual (the man and info pages are full of
stuff on how you'd do that).

-- 
Chris Jackson
Now with enhanced time-wasting capabilities
Non-Terminal Boredom: http://www.xpns.co.uk/life/



More information about the Swlug mailing list