|
FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|||
Cron won't execute a perl script
I've set up a little script, written in Perl that keeps stats of ping timeous. I want to schedule it to run every 5 minutes.
This is my crontab: Code:
*/5 * * * * /usr/bin/perl /home/ivanatora/dev/ping_stats.pl > /home/ivanatora/cronlog And here is the script: Code:
> cat ping_stats.pl #!/usr/bin/perl $dump = "/home/ivanatora/stats_ping_packet_loss.log"; open (FH, ">>", $dump) or die "$!"; ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); $mon++; $year += 1900; $time = sprintf("%02d/%02d/%4d %02d:%02d:%02d", $mday, $mon, $year, $hour, $min, $sec); $output = `ping -q -c200 xx.xxx.xxx.xxx`; if ($output =~ /(\d+?)% packet loss/){ print FH "$time : $1% loss\n"; print "$time : $1% loss\n"; } close (FH); I see this in /var/log/cron: Code:
Aug 16 15:05:00 jupiter /usr/sbin/cron[1535]: (ivanatora) CMD (/usr/bin/perl /home/ivanatora/dev/ping_stats.pl > /home/ivanatora/cronlog) I'm about to say again that the script is working if run manualy, or even working in Linux crontab. What am I doing wrong in FreeBSD? |
|
||||
Quote:
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. |
|
|||
I'm using the regular user crontab -e.
Thank you all! |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
"free" command/perl script for freebsd | unixdude | FreeBSD General | 0 | 17th November 2008 09:23 PM |
execute commands from xinitrc | rex | FreeBSD General | 3 | 22nd October 2008 10:24 PM |
Execute a command during login | rex | FreeBSD General | 4 | 12th September 2008 08:09 PM |
Cronjob script does not run in cron | godfrank | FreeBSD General | 9 | 30th June 2008 12:41 AM |
Perl Script | c0mrade | Programming | 1 | 26th June 2008 05:04 AM |