Thyagaraj03
asked on
Exclude files/directores while tar extraction
I used "tar -cvzf clone.tgz /" to backup the root directory '/' on my ubuntu 9.10 server. Now I want to extract it on a newly installed machine. How could I exclude files and directories while tar extraction.
For extraction I'll be using "tar -xvpzf clone.tgz -C /" which overwrites all the files and directories.
Let say I want to exclude the directory '/etc/udev/' and a file '/home/file1' while Extracting the tar file. Is it possible to do so?
For extraction I'll be using "tar -xvpzf clone.tgz -C /" which overwrites all the files and directories.
Let say I want to exclude the directory '/etc/udev/' and a file '/home/file1' while Extracting the tar file. Is it possible to do so?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Post output of "tar ztf clone.tgz" command.
ASKER
Thanks a lot!. Blaz made a small change and it worked.
ASKER
tar -xvpzf clone.tgz --exclude "/etc/udev" --exclude "/home/file1" -C /test/
The 'test' directory has the udev dir. and the file1 in the respective directories. What I'm doing wrong?.