Path: utzoo!attcan!uunet!spool.mu.edu!sol.ctr.columbia.edu!emory!gatech!udel!haven!uvaarpa!mmdf From: anderson@optical.squibb.com Newsgroups: comp.lang.perl Subject: lossage running perl script from crontab Message-ID: <1991Feb28.193638.4002@uvaarpa.Virginia.EDU> Date: 28 Feb 91 19:36:38 GMT Sender: mmdf@uvaarpa.Virginia.EDU (Uvaarpa Mail System) Reply-To: anderson@optical.squibb.com Organization: The Internet Lines: 36 When I run the following script from the csh prompt, it works fine. However, when I try to run it from cron it doesn't quite work as expected. Here's the crontab entry: 0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/local/bin/perl /usr/local/bin/cron_ping Here's cron_ping: #!/usr/local/bin/perl # # Script to ping bozo to insure network # integrity. open(LOG, ">>/var/log/ping_log") || die "Can't open /var/log/ping_log"; chop($date = `date`); chop($result = `ping bozo 5`); # try for 5 secs to ping helix print LOG $date ," ", $result, "\n"; close(LOG); Here's what /var/log/ping_log looks like: Thu Feb 28 14:15:02 EST 1991 <- from cron Thu Feb 28 14:20:01 EST 1991 <- from cron Thu Feb 28 14:25:02 EST 1991 <- from cron Thu Feb 28 14:28:20 EST 1991 helix is alive <- by hand Thu Feb 28 14:28:38 EST 1991 helix is alive <- by hand Thu Feb 28 14:30:01 EST 1991 <- from cron Why does it work from the shell and not from cron? Jay Anderson anderson@optical.squibb.com