tags:

views:

97

answers:

1

I have the following folder structure. myFolder and testFolder have same folders underneath it and I want to exclude only my1 from testFolder and not myFolder

"myFolder" which has -my1 -my2 -my3

"testFolder" which has -my1 -my2 -my3

I am trying to use exclude tag along with included folders while creating a tar file. This is what i have, but it does not seem to work.

tar -cvf base.tar "/sam/myFolder" "/sam/testFolder" --exclude="/sam/testFolder/my1"

I want to exclude my1 from testFolder and not myFolder. can you please suggest a possible solution.

A: 

I am not a techie in perl. This is what i found after a bit of research.

The command was correct. The only problem was with the paths. we need to be careful with the relative paths.

folder structure: D:\tools\Packet\sam\

D:\tools\Packet>tar -pcvf base.tar "sam/myFolder" "sam/testFolder" --exclude "sam/testFolder/my1"

-cvf -pcvf both work fine.

superstar