On Oct 18, 2011, at 3:25 PM, Michael Rasmussen wrote:
> It doesn't die?
>
> Are you sure it runs? ie, does the root crontab have the proper path
> elements for this to function?
>
> Check the return code from print. As in:
>
> sub writetemp {
> open (NEWFILE, ">/tmp/$0.count") or die $!;
> my $ok = print NEWFILE "$product{name}.value $product{value} $date";
> if ( ! $ok ) {
> print STDERR "error on print to file: $!\n";
> }
> close (NEWFILE);
> }
>
> or print NEWFILE "$product{name}.value $product{value} $date" or warn "$!";
As a test, I set it up under the ubuntu user. When run from the command line,
the script runs and properly creates the expected output file in the /tmp
directory.
When I set up the crontab to run the script as ubuntu, I get an email saying:
"No such file or directory at /home/ubuntu/bin/test line 99."
which is the 'open' in the script.
Russell Johnson
[email protected]
_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug