Perl script with `command` in cron not right

corliss at alaskapm.org corliss at alaskapm.org
Thu May 11 19:36:51 CDT 2000


On Thu, 11 May 2000, K Creason wrote:

> This may seem a little twisted, if so, I'd appreciate being straightened
> out. I've cross posted this with the Perl user group and the linux group,
> because I'm not sure where the problem lies.
> 
> I have a Perl script I scheduled in cron.
> BUT (of course there's a but to this)
> this line:
> $r=`cat /home/911/alert.msg |smbclient -M $mac[$c] -R wins -U "911 Alert"`;
> 
> will do every thing up to the included pipe command. The script works
> perfect from the command line, cron just doesn't do that part.
> I know cron does some of it's won redirections, so is it the multiple
> redirect*s that go on in a cron job?
> I've tried the cron job scheduled like these two ways, following my HP-UX
> experience:
> * * * * * /home/911/ptel.pl >/home/911/ptel.log
> and
> * * * * *  /home/911/ptel.pl
> 
> It's never logged a thing to the cron piped log, so maybe that HP function
> isn't included in linux. I 've altered the perl line to include full path to
> the smbclient binary, no fix the problem.
> The cat function works, the alert.msg file is always updated.

I'd check to see if smbclient is in the path (cron runs with stricter
restrictions that shells do).

	--Arthur Corliss
	  Perl Monger/Alaska Perl Mongers
	  http://www.alaskapm.org/

=================================================
Mailing list info:  If at any time you wish to (un|re)subscribe to
the list send the request to majordomo at hfb.pm.org.  All requests
should be in the body, and look like such
                  subscribe anchorage-pm-list
                  unsubscribe anchorage-pm-list



More information about the Anchorage-pm mailing list