Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tar help... 1

Status
Not open for further replies.
Oct 22, 2001
215
US
Hi,
I got 2 dir (test1 and test2) that I want compress with 'tar' except 1 file (logon) in test2.

I am trying the following but don't know what am I doing wrong..... it is saying logon file excluded but, there is nothing on the test.tar that I am creating!
#######################################
tar -cvfX test.tar test1 test2 test2/logon
#######################################

Note: the tar command works well that is it compress when I use -cvf and does not include any of the filewhen I use -cvfX. How can I use both?
 
You need to create a file that lists the directories/files to exclude, then specify it on the command line after the tar file you are creating, but before the directories you are tarring.

Example: Create a file called "ex" that contains the line "test2/logon". Then:

tar cvfX test.tar ex test1 test2
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top