[PLUG] Temp directory weirdness
John Meissen
john at meissen.org
Tue Oct 18 23:46:04 UTC 2011
Make sure you're using the correct shell. Ubuntu sets /bin/sh to 'dash'
by default, which is a limited shell that doesn't have all of the
capabilities of normal 'bash'. Supposedly makes running scripts
quicker.
>
> 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
> russ at dimstar.net
>
>
>
> _______________________________________________
> PLUG mailing list
> PLUG at lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
More information about the PLUG
mailing list