* Tar Exclude
@ 2002-11-13 15:17 Paul Kraus
2002-11-13 15:22 ` Mike Dresser
2002-11-13 17:11 ` Steven Smith
0 siblings, 2 replies; 8+ messages in thread
From: Paul Kraus @ 2002-11-13 15:17 UTC (permalink / raw)
To: linux-newbie
[-- Attachment #1: Type: text/plain, Size: 473 bytes --]
When running tar with the exclude set tar creates a 10k empty tar file.
I have a script that tars a all the sub directories of a directory into
individual tar files for each subdirectory. I have an exclude file that
is set to skip some of the folders I don't want tarred. This works but
it creates the empty tar files. Is this normal? Can it be set not to do
this?
Paul Kraus
Network Administrator
PEL Supply Company
216.267.5775 Voice
216-267-6176 Fax
www.pelsupply.com
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Paul Kraus (pkraus@pelsupply.com).vcf --]
[-- Type: text/x-vcard; name="Paul Kraus (pkraus@pelsupply.com).vcf", Size: 592 bytes --]
BEGIN:VCARD
VERSION:2.1
N:Kraus;Paul
FN:Paul Kraus (pkraus@pelsupply.com)
ORG:PEL Supply Company
TITLE:Network Administrator
TEL;WORK;VOICE:(216) 267-5775
TEL;CELL;VOICE:(216) 410-5526
TEL;WORK;FAX:(216) 267-6176
ADR;WORK:;;4666 Manufacturing Road;Cleveland;Ohio;44135;United States of America
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:4666 Manufacturing Road=0D=0ACleveland, Ohio 44135=0D=0AUnited States of Ame=
rica
ADR;HOME:;;;;;;United States
LABEL;HOME:United States
URL;WORK:http://www.pelsupply.com
EMAIL;PREF;INTERNET:pkraus@pelsupply.com
REV:20020416T182124Z
END:VCARD
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Tar Exclude
2002-11-13 15:17 Tar Exclude Paul Kraus
@ 2002-11-13 15:22 ` Mike Dresser
2002-11-13 15:25 ` Paul Kraus
2002-11-13 17:11 ` Steven Smith
1 sibling, 1 reply; 8+ messages in thread
From: Mike Dresser @ 2002-11-13 15:22 UTC (permalink / raw)
To: Paul Kraus; +Cc: linux-newbie
On Wed, 13 Nov 2002, Paul Kraus wrote:
> When running tar with the exclude set tar creates a 10k empty tar file.
>
> I have a script that tars a all the sub directories of a directory into
> individual tar files for each subdirectory. I have an exclude file that
> is set to skip some of the folders I don't want tarred. This works but
> it creates the empty tar files. Is this normal? Can it be set not to do
> this?
How about showing us the line out of the script that calls tar, and a
sample of your exclude line. Tar can be... tempermental when it comes to
exclude's.
Mike
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: Tar Exclude
2002-11-13 15:22 ` Mike Dresser
@ 2002-11-13 15:25 ` Paul Kraus
0 siblings, 0 replies; 8+ messages in thread
From: Paul Kraus @ 2002-11-13 15:25 UTC (permalink / raw)
To: 'Mike Dresser'; +Cc: linux-newbie
Here is the script
------------------
exceptions=/backup/scripts/archive.exclude
dt=`date +%A`
cd /backup
for filestotar in `ls --almost-all --directory -x1 *`
do
tar --directory /backup/tar.archive \
--create --verbose \
--exclude-from $exceptions \
--file /backup/tmp/$filestotar.$dt.tar \
/backup/$filestotar/* 1>
/backup/tmp/$filestotar.$dt.index
done
-----Original Message-----
From: Mike Dresser [mailto:mdresser_l@windsormachine.com]
Sent: Wednesday, November 13, 2002 10:22 AM
To: Paul Kraus
Cc: linux-newbie@vger.kernel.org
Subject: Re: Tar Exclude
On Wed, 13 Nov 2002, Paul Kraus wrote:
> When running tar with the exclude set tar creates a 10k empty tar
> file.
>
> I have a script that tars a all the sub directories of a directory
> into individual tar files for each subdirectory. I have an exclude
> file that is set to skip some of the folders I don't want tarred. This
> works but it creates the empty tar files. Is this normal? Can it be
> set not to do this?
How about showing us the line out of the script that calls tar, and a
sample of your exclude line. Tar can be... tempermental when it comes
to exclude's.
Mike
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: Tar Exclude
@ 2002-11-13 15:31 Paul Kraus
2002-11-13 15:51 ` Mike Dresser
2002-11-14 0:46 ` dashielljt
0 siblings, 2 replies; 8+ messages in thread
From: Paul Kraus @ 2002-11-13 15:31 UTC (permalink / raw)
To: linux-newbie
Also I just noticed I get an error about removing leading / from member
names.
Here is my archive.exclude
/backup/advserver
/backup/logs
/backup/lost+found
/backup/scripts
/backup/tar.archive
-----Original Message-----
From: Paul Kraus [mailto:pkraus@pelsupply.com]
Sent: Wednesday, November 13, 2002 10:26 AM
To: 'Mike Dresser'
Cc: 'linux-newbie@vger.kernel.org'
Subject: RE: Tar Exclude
Here is the script
------------------
exceptions=/backup/scripts/archive.exclude
dt=`date +%A`
cd /backup
for filestotar in `ls --almost-all --directory -x1 *`
do
tar --directory /backup/tar.archive \
--create --verbose \
--exclude-from $exceptions \
--file /backup/tmp/$filestotar.$dt.tar \
/backup/$filestotar/* 1>
/backup/tmp/$filestotar.$dt.index
done
-----Original Message-----
From: Mike Dresser [mailto:mdresser_l@windsormachine.com]
Sent: Wednesday, November 13, 2002 10:22 AM
To: Paul Kraus
Cc: linux-newbie@vger.kernel.org
Subject: Re: Tar Exclude
On Wed, 13 Nov 2002, Paul Kraus wrote:
> When running tar with the exclude set tar creates a 10k empty tar
> file.
>
> I have a script that tars a all the sub directories of a directory
> into individual tar files for each subdirectory. I have an exclude
> file that is set to skip some of the folders I don't want tarred. This
> works but it creates the empty tar files. Is this normal? Can it be
> set not to do this?
How about showing us the line out of the script that calls tar, and a
sample of your exclude line. Tar can be... tempermental when it comes
to exclude's.
Mike
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: Tar Exclude
2002-11-13 15:31 Paul Kraus
@ 2002-11-13 15:51 ` Mike Dresser
2002-11-14 0:46 ` dashielljt
1 sibling, 0 replies; 8+ messages in thread
From: Mike Dresser @ 2002-11-13 15:51 UTC (permalink / raw)
To: Paul Kraus; +Cc: linux-newbie
On Wed, 13 Nov 2002, Paul Kraus wrote:
> Also I just noticed I get an error about removing leading / from member
> names.
>
> Here is my archive.exclude
> /backup/advserver
> /backup/logs
> /backup/lost+found
> /backup/scripts
> /backup/tar.archive
>
Try putting
backup/advserver
backup/logs
backup/lost+found
backup/scripts
backup/tar.archive
Instead
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: Tar Exclude
[not found] <078901c28b2c$aa2664e0$64fea8c0@pkrausxp>
@ 2002-11-13 15:59 ` Mike Dresser
0 siblings, 0 replies; 8+ messages in thread
From: Mike Dresser @ 2002-11-13 15:59 UTC (permalink / raw)
To: Paul Kraus; +Cc: linux-newbie
On Wed, 13 Nov 2002, Paul Kraus wrote:
> I removed /backup/ from all of them.
>
> Advserver
> Logs
> Ect.
>
> And like before it stills excludes them by not tarring there contents
> but it does create the 10k empty tar file.
Sorry, I got completely sidetracked with the idea of excludes not working,
when in fact they were in the first place
I don't know what the problem is, unfortunately.
Sorry,
Mike
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Tar Exclude
2002-11-13 15:17 Tar Exclude Paul Kraus
2002-11-13 15:22 ` Mike Dresser
@ 2002-11-13 17:11 ` Steven Smith
1 sibling, 0 replies; 8+ messages in thread
From: Steven Smith @ 2002-11-13 17:11 UTC (permalink / raw)
To: Paul Kraus; +Cc: linux-newbie
[-- Attachment #1: Type: text/plain, Size: 974 bytes --]
> I have a script that tars a all the sub directories of a directory into
> individual tar files for each subdirectory. I have an exclude file that
> is set to skip some of the folders I don't want tarred. This works but
> it creates the empty tar files. Is this normal?
Yes. It is, in fact, exactly what you've told tar to do: create
a tar file containg everything in directory foo, excluding files
in directory foo. This gives us an empty tar file.
> Can it be set not to do this?
I can't see any immediately obvious way to stop tar making empty
files, but you could try a script like this:
tar --create ... # Whatever arguments you're currently using for tar.
[ `tar -tf foo.tar | wc -l` -eq 0 ] && rm foo.tar
replacing foo.tar with the filename of the generated tarball which
might be empty. (The second line checks whether the tar file is
empty, and rm-s it if it is).
This isn't a terribly pleasant solution, but it should work.
Steven Smith,
sos22@cam.ac.uk.
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: Tar Exclude
2002-11-13 15:31 Paul Kraus
2002-11-13 15:51 ` Mike Dresser
@ 2002-11-14 0:46 ` dashielljt
1 sibling, 0 replies; 8+ messages in thread
From: dashielljt @ 2002-11-14 0:46 UTC (permalink / raw)
To: Paul Kraus; +Cc: linux-newbie
You want to have /proc in that exclude along with /tmp.
Jude <dashielljt@gmpexpress.net>
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2002-11-14 0:46 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-13 15:17 Tar Exclude Paul Kraus
2002-11-13 15:22 ` Mike Dresser
2002-11-13 15:25 ` Paul Kraus
2002-11-13 17:11 ` Steven Smith
-- strict thread matches above, loose matches on Subject: below --
2002-11-13 15:31 Paul Kraus
2002-11-13 15:51 ` Mike Dresser
2002-11-14 0:46 ` dashielljt
[not found] <078901c28b2c$aa2664e0$64fea8c0@pkrausxp>
2002-11-13 15:59 ` Mike Dresser
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox