tar -T -X

Anita Lewis ajlewis2
Mon May 17 11:28:14 PDT 2004


On Sun, 10 Mar 2002 12:08:08 +0800, Chang[linuxism] wrote:
> given the following directory structure:
> 
> /home
> /home/httpd/html
> /home/httpd/html/linux-sxs
> /home/httpd/icons
> 
> Is it possible to tar backup everything in /home except
> /home/httpd/html/linux-sxs?
> 
> I tried:
> 
> tar cvzfp /home/backup/linux.backup.tgz -T /tmp/filelist -X /tmp/xclude
> 
> file /tmp/filelist:
> /home/
> /etc/
> 
> file /tmp/filelist:
> /home/httpd/html/linux-sxs/
> 
> but tar still include the linux-sxs sub-dir.
> 
> 
I'm glad you asked this, because I couldn't get it to work a while back and
gave up.  I tried again this morning and found that I need to do this with
the exclude file:

/home/httpd/html/linux-sxs/*

Just add the asterisk to tell it what files (all files). For the include
file, I did not use the asterisk.

Anita



More information about the Linux-users mailing list