Roger,
Are you using gnu tar? You might want to...you 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:
ftp://cpan.nas.nasa.gov/pub/perl/CPAN/modules/by-module/Archive
Have fun!
Aaron
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.