[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] OT perl/linux on a raq4



INRE Re: [cobalt-users] OT perl/linux on a raq4:
> On 11/2/03 4:10, "Larry Smith" <lesmith@xxxxxxxxx> wrote:
> > INRE [cobalt-users] OT perl/linux on a raq4:
> >> Hi.
> >>
> >> I got a very specific query.
> >> Its a linux/perl thing to be truthful, but the same command works on my
> >> raq3's, and has only just stopped working on my only raq4.
> >>
> >> Its an archive script, in perl, which calls the linux commands.
> >>
> >> # The following three lines required to execute unix shell commands.
> >>
> >>    $ENV{'PATH'} = '/bin:/usr/bin';    # or whatever you need
> >>    $ENV{'SHELL'} = '/bin/sh' if $ENV{'SHELL'} ne '';
> >>    $ENV{'IFS'} = '' if $ENV{'IFS'} ne '';
> >>
> >>    chdir $dir or die "Cannot chdir: $!";
> >>
> >>    @args = ("tar", "cf", "archive.tar", <*.html>);
> >>    system(@args) == 0 or die "system @args failed: $?";
> >>
> >>
> >> It crashes out on the <*.html> but never used to.
> >> If I replace it with "specific_filename.html" then there is no problem,
> >> but the wildcard it does not like.
> >>
> >> I recently installed a couple of bits of software on here, quicktime
> >> streamer, and webalizer, and since, the above comments don't work!
> >>
> >> Anyone any ideas why that would have changed?
> >
> > Step
> >
> > Try "ls *.html | wc -l" and see how many files there are.  Sounds like
> > you are crossing the bounds of how much the @args variable can hold.  EG
> > too many filenames for the program to hold at one time.
>
> Hi Larry.
>
> Nope, not that. Took it right down to just 2 files. The scripts run on my
> message boards, with 1000's of messages archive per go. The scripts run
> across our servers on many sites, but only on one Raq4 server,three
> different instances of the script, have JUST started internal server
> erroring in this statement:
>
>     @args = ("tar", "cf", "archive.tar", <*.html>);
>
> It IS actually the setting of the args array that causes it, but as I said,
> it errors with a tiny number (2) of .html files.
>
> Its a weird one.
>

Step

Hmmm,  Ok, how about changing this part:

> >>    @args = ("tar", "cf", "archive.tar", <*.html>);
> >>    system(@args) == 0 or die "system @args failed: $?";

To read something like:

> @args = ("tar", "cf", "archive.tar");
> @args2 = (<*.html>);
> system(@args, @args2) == 0 or die "system @args failed: $?";

And see if you get the same error.  Question is to find out "what" about the 
line that the server does not "like"....  EG what is causing the error.

-- 
Larry Smith
SysAd ECSIS.NET
sysad@xxxxxxxxx