Message-ID: <3A2283B1.A8A87AF@gypsyfarm.com>
Date: Mon, 27 Nov 2000 10:54:25 -0500
From: zentara
Hi! I hope someone can help me with this irritating little problem. Let's assume I want to tar "/home/userX" and that I have two directories with the same name 1. /home/userx/xyz 2. /home/userx/numbertwo/xyz - not wanted in archive If I use "tar -czf tmp.tgz --exclude 'xyz' /home/userx" > Both archives "xyz" are excluded If I use "tar -czf tmp.tgz --exclude '/home/userx/numbertwo/xyz' /home/userx" > Both archives "xyz" are INCLUDED
I have tried some different ways of expressing the "--exclude '/home/userx/numbertwo/xyz'" part, but no luck so far, can someone please point me in the right direction
There is a better exclude method involving a file listing the files and directories which you want to exclude. Look at man tar, but it goes something like tar -cvf my.tgz --exclude notar.txt /home then create a file called notar.txt and put each unwanted file and directory in it on a separate line.