Re: Command line vs. cron

2006-09-13 Thread Mumia W.
On 09/13/2006 06:07 PM, James Marks wrote: What turned out to work — although I haven't figured out why yet — is to to use 'acx' rather than 'aux' and to include that within the single quotes as in: open PS, '-|', '/bin/ps acx' or die "Cannot open pipe from ps: $!"; The above line results i

Re: Command line vs. cron

2006-09-13 Thread Igor Sutton
There's some reason to not use Proc::ProcessTable? It is really easy to use, and doesnt' relies on environment variables to be used. -- Igor Sutton Lopes t: +55 51 9627.0779 e: [EMAIL PROTECTED]

Re: Command line vs. cron

2006-09-13 Thread James Marks
On Sep 13, 2006, at 3:50 PM, John W. Krahn wrote: James Marks wrote: If I've correctly interpreted your suggested changes, the script now reads: -- SCRIPT -- #!/usr/bin/perl use warnings; use strict; my $log_file = '/home/james/httpsd_mysqld.log'; open FILE_OUT, ">> $log_

Re: Command line vs. cron

2006-09-13 Thread John W. Krahn
James Marks wrote: > > If I've correctly interpreted your suggested changes, the script now > reads: > > -- SCRIPT -- > > #!/usr/bin/perl > > use warnings; > use strict; > > my $log_file = '/home/james/httpsd_mysqld.log'; > > open FILE_OUT, ">> $log_file" > or die "Cannot

Re: Command line vs. cron

2006-09-13 Thread James Marks
(snip) Here's the script: #!/usr/bin/perl use warnings; use strict; my $log_file = '/home/james/code/cron_code/httpsd_mysqld_log_file'; open FILE_OUT, ">> $log_file" or die "Cannot open log file: $!"; select FILE_OUT; (my $month, my $day, my $year, my $hour, my $minute, my $second) = (l

Re: Command line vs. cron

2006-09-13 Thread James Marks
On Sep 13, 2006, at 1:01 AM, Travis Thornhill wrote: I was just looking into the %ENV hash in my trusty Programming Perl book and found this interesting note on p. 661: "Note that processes running as crontab(5) entries inherit a particularly impoverished set of environment variables. (

Re: Command line vs. cron

2006-09-13 Thread Travis Thornhill
I was just looking into the %ENV hash in my trusty Programming Perl book and found this interesting note on p. 661: "Note that processes running as crontab(5) entries inherit a particularly impoverished set of environment variables. (If your program runs fine from the command line but not u

Re: Command line vs. cron

2006-09-13 Thread James Marks
On Sep 13, 2006, at 12:29 AM, John W. Krahn wrote: #!/usr/bin/perl use warnings; use strict; my $log_file = '/home/james/code/cron_code/httpsd_mysqld_log_file'; open FILE_OUT, ">> $log_file" or die "Cannot open log file: $!"; select FILE_OUT; (my $month, my $day, my $year, my $hour, my

Re: Command line vs. cron

2006-09-13 Thread John W. Krahn
James Marks wrote: > Hi folks, Hello, > I don't know if this is a Perl or UNIX problem and I'm hoping you can > help me figure that out. > > I wrote a script that checks to see if the httpsd and mysqld processes > are running on my server and to log the results of those tests. > > When I run th

Re: Command line vs. cron

2006-09-12 Thread James Marks
On Sep 12, 2006, at 11:02 PM, Mumia W. wrote: On 09/12/2006 11:28 PM, James Marks wrote: Hi folks, I don't know if this is a Perl or UNIX problem and I'm hoping you can help me figure that out. I wrote a script that checks to see if the httpsd and mysqld processes are running on my server an

Re: Command line vs. cron

2006-09-12 Thread Mumia W.
On 09/12/2006 11:28 PM, James Marks wrote: Hi folks, I don't know if this is a Perl or UNIX problem and I'm hoping you can help me figure that out. I wrote a script that checks to see if the httpsd and mysqld processes are running on my server and to log the results of those tests. When I

Re: Command line vs. cron

2006-09-12 Thread James Marks
On Sep 12, 2006, at 10:28 PM, Owen Cook wrote: Here's the script: #!/usr/bin/perl use warnings; use strict; my $log_file = '/home/james/code/cron_code/httpsd_mysqld_log_file'; open FILE_OUT, ">> $log_file" or die "Cannot open log file: $!"; select FILE_OUT; (my $month, my $day, my $y

Re: Command line vs. cron

2006-09-12 Thread Owen Cook
On Tue, 12 Sep 2006, James Marks wrote: > > On Sep 12, 2006, at 9:59 PM, Owen Cook wrote: > > >> Here's the script: > >> > >> #!/usr/bin/perl > >> > >> use warnings; > >> use strict; > >> > >> my $log_file = '/home/james/code/cron_code/httpsd_mysqld_log_file'; > >> > >> open FILE_OUT, ">> $log_

Re: Command line vs. cron

2006-09-12 Thread James Marks
On Sep 12, 2006, at 9:59 PM, Owen Cook wrote: Here's the script: #!/usr/bin/perl use warnings; use strict; my $log_file = '/home/james/code/cron_code/httpsd_mysqld_log_file'; open FILE_OUT, ">> $log_file" or die "Cannot open log file: $!"; select FILE_OUT; (my $month, my $day, my $ye

Re: Command line vs. cron

2006-09-12 Thread Owen Cook
On Tue, 12 Sep 2006, James Marks wrote: > Hi folks, > > I don't know if this is a Perl or UNIX problem and I'm hoping you can > help me figure that out. > > I wrote a script that checks to see if the httpsd and mysqld processes > are running on my server and to log the results of those tests.

Command line vs. cron

2006-09-12 Thread James Marks
Hi folks, I don't know if this is a Perl or UNIX problem and I'm hoping you can help me figure that out. I wrote a script that checks to see if the httpsd and mysqld processes are running on my server and to log the results of those tests. When I run the script from the command line, the sc