LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-23-2004, 08:56 AM   #1
drisay
Member
 
Registered: Sep 2004
Distribution: Slackware 10
Posts: 167

Rep: Reputation: 30
tar exclude-from


I have tried the following commands:

Code:
tar -cvzf test.tar.gz -X excluded_files .
or
tar -cvzf test.tar.gz --exclude-from=excluded_files .
with the following entries in excluded_files file:
Code:
*.mp3
*.ogg
*.wma
for some reason it doesn't work. all the files get added to the archive. if i explicitely name each of the patterns on the command line it works fine.

Code:
tar -cvzf test.tar.gz --exclude=*.mp3 --exclude=*.ogg --exclude=*.wma .
Any ideas what I am doing wrong in the first example. Is the syntax of the exclude file wrong? I put one entry per line as it says in the man pages of tar.

Thanks in advance for any help,
drisay.
 
Old 12-23-2004, 01:10 PM   #2
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 243Reputation: 243Reputation: 243
I would try to use find to build the exclude list, like

find /home -name "*.mp3" > excluded_files
find /home -name "*.wma" >> excluded_files
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Tar won't exclude directories. yougene Slackware 9 12-01-2005 09:32 AM
tar --exclude --exclude-from cefn Linux - Software 4 10-11-2005 07:31 PM
tar --exclude-from=FILE GATTACA Programming 1 07-29-2005 12:25 PM
Exclude directories when backing up with 'tar'? wolfpeach Linux - Newbie 2 06-28-2004 10:54 AM
tar --exclude for subdirectories mrtwice Linux - Software 2 10-23-2003 12:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration