tar exclude tag
- by superstar
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.