backup and hidden files in tar

Robert P. J. Day rpjday at mindspring.com
Thu Jul 22 16:48:32 UTC 2004


>>> J.L. Coenders wrote:
>>>> Hi,
>>>> How do I include backup and hidden files in my tar archives? I want a
>>>> complete backup of my home directory, including all settings.

do the backup relative to the current directory.  go to the directory 
in question and:

   $ tar cvf mybackup.tar .    (not "*", but ".")

that will pick up everything, including hidden thingies that start 
with "." in the current directory.

one warning, though.  if you do this, the contents of the archive will 
appear, not as:

   file
   file
   file

but as:

   ./file
   ./file
   ./file

and you have to extract them that way as well.  GNU tar is stupidly 
literal, and if you ask for "file" instead of "./file", it will go 
"huh?".

rday





More information about the users mailing list