[NTLUG:Discuss] Tar Exclude file question

Ed Coates edcoates at nighthawk.dyndns.org
Fri Feb 6 14:19:03 CST 2004



On Fri, 6 Feb 2004, Stephen Davidson wrote:

> Greetings.
>
> I am trying to put together a custom backup script using tar.  Due to file size limitations, I need to break the tar file down into some smaller
> chunks.  So. what I am trying to do is tar this one directory, w/o several very large subdirectories in it.  Each subdirecty in question (about 6
> out of 20) will be its own tar ball.
>
> So I figured I would run tar on the directory, and list the subdirectories in question as exclusions using the -X option.  Problem is, when I put
> more than one file in the excludefiles.txt file, tar won't add anything.  So what is the format for multiple files?  I have tried several variations;
>
> first idea;
> dir1
> dir2
> dir3
>
> second idea
> dir1 dir2 dir3
>
> third idea
> dir1, dir2, dir3
>
> So what should it be?
>
> Thanks,
> Steve
Steve,

According to     info tar  the -X <file>   will look in <file> and exclude
all those files listed there.  Either, make a file with all the dirs/files
included in it, or maybe try the --exclude=<pattern>


Ed



More information about the Discuss mailing list