[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Cheshire Cat Computing • View topic - Graphprune.pl not working from a cron job

Cheshire Cat Computing

Software support and information
It is currently Mon Dec 22, 2025 10:30 am

All times are UTC + 12 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Tue Jan 25, 2005 10:30 am 
Offline
User

Joined: Tue Jan 25, 2005 9:45 am
Posts: 2
When i run graphprune.pl at the prompt (exactly as it is in the script file below), I get messages like this:
[root@hnb-monitor root]# perl /home/mrtg/conf/graphprune.pl
Info: Cleaned up 349 file(s) in graphs directory.
Info: Cleaned up 0 old archive graph(s)

But everyday after the cron job I get an email to root with this message:
/etc/cron.daily/graphprune:
Illegal division by zero at /etc/cron.daily/graphprune line 10.

Here is my cron script (/etc/cron.daily/graphprune):
#!/usr/bin/perl
perl /home/mrtg/conf/graphprune.pl (this is line 10, there are comments above it).

These are the file permissions:
-rwxr-xr-x 1 root root 212 Jan 21 12:16 graphprune (/etc/cron.daily)
-rwxr-xr-x 1 root root 3812 Jan 10 14:31 graphprune.pl (/home/mrtg/conf)
-r-xr-xr-x 1 root root 238131 Nov 24 08:15 routers2.cgi (/var/www/cgi-bin)
-rw-rw-r-- 1 root root 22391 Jan 21 10:32 routers2.conf(/home/mrtg/conf)

Here are the configurable lines from graphprune.pl:
my( $conffile ) = "/home/mrtg/conf/routers2.conf";
my( $archmaxage ) = 0;

My routers2.conf file has these lines:
[graphprune]
# number of days after which to delete archived graphs
archmaxage = 0


This is a WhiteBox 3.0 respin1 Linux install, perl is 5.8.0.

This isn't a big problem, but it would be nice to find out why it's doesn't seem to work from the cron job. (Especially, since I tend to forget to do the clean up manually). Any help would be appreciated. THX

Gene White


Top
 Profile Send private message  
 
 Post subject:
PostPosted: Tue Jan 25, 2005 10:43 am 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3039
Location: Auckland, New Zealand
This is your problem:

#!/usr/bin/perl
perl /home/mrtg/conf/graphprune.pl

Your are using a #! line specifying that this is a perl script, but in fact it is a shell script that calls a perl script (graphprune.pl is pa perl script, you have written a shellscript).

Try this:

#!/bin/sh
/usr/bin/perl /home/mrtg/conf/graphprune.pl

(You may need to modify the paths for /bin/sh and /usr/bin/perl depending on your system).

The 'divide by zero' error came from perl, which thought you wanted to divide 'home' by 'mrtg' when it saw home/mrtg.

_________________
Steve Shipway
UNIX Systems, ITSS, University of Auckland, NZ
Woe unto them that rise up early in the morning... -- Isaiah 5:11


Top
 Profile Send private message  
 
 Post subject:
PostPosted: Wed Jan 26, 2005 6:17 am 
Offline
User

Joined: Tue Jan 25, 2005 9:45 am
Posts: 2
DUH!!! Wow, I sure missed that one! Thanks Steve.


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 12 hours [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group