Really OT: Any tar experts here?

From: Aaron Christopher Finney <>
Date: Tue Sep 14 03:53:49 1999


Are you using gnu tar? You might want should be able to use the
-T (include files list) and -X (exclude files list) options for this.
Like: system("/usr/bin/tar -T ./include.list -X ./exclude.list");
Or sans shell:
$result=system("/usr/bin/tar", "-T ./include.list", "-X./exclude.list");

For dumb versions of tar, you can probably get creative with executing cat
as a subshell (inside backquotes) like: $tar cvf backupfile.tar `cat
include.list` or some such rubbish. If you do that, you can cheat and use
the tee command (if it's on your system...) to split the piped output into
a results file. I'm sure there are more elegant solutions, but what do you
want after a couple-of-few pints of Guinness?

I personally use the Archive::Tar module for this kind of thing though:

Have fun!


On Mon, 13 Sep 1999, Roger Merchberger wrote:

> Sorry for the off-topic post, but I'm tired of beating what's left of my
> brains on what's left of my desk... Please, Please, Please, private email
> replies only.
> Non-essential info: I'm writing a selective backup program in Perl to read
> a config file, use the info to create a list of directories to be backed
> up, then give that listing to tar to back up the information.
> Essential info: Problem is, I have directories that I want backed up, but
> with subdirectories that I *don't* want backed up; yet when I feed the list
> of dir's to tar, it recursively backs up the dir's anyway.
> Is there a way (program switch, special version of tar, anything...) to
> tell tar to not recurse subdirectories, or do I need to write a sub-program
> that extracts each individual filename?
> Thanks in advance for any help that can be provided.
> Roger "Merch" Merchberger
> --
> Roger "Merch" Merchberger --- sysadmin, Iceberg Computers
> Recycling is good, right??? Ok, so I'll recycle an old .sig.
> If at first you don't succeed, nuclear warhead
> disarmament should *not* be your first career choice.
Received on Tue Sep 14 1999 - 03:53:49 BST

This archive was generated by hypermail 2.3.0 : Fri Oct 10 2014 - 23:32:36 BST