LeRoy on 30 Apr 2010 07:19:55 -0700

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Script doesn't seem to run in cron...

Hash: SHA1

On 04/30/2010 09:29 AM, Mike Leone wrote:
> I have a script I want to execute at a scheduled time. I can run the 
> script from the command line with no problems - it executes correctly. 
> But doesn't seem to run from cron (at least, I get no output files in  a 
> certain directory, as I do when I run it from a command line).
> And I can't seem top find a cron log anywhere. I see in syslog that it 
> is executing (I think), but I don't know why it's not working.
> $ sudo crontab -l
> # m h  dom mon dow   command
>   30 9  30   4   * /Scripts/Get-Invoices.sh
Hi Mike,

I think that your problem could be that you need to put the complete
path of the executables in the script.  For instance, when you call a
simple command like cp or anything else, you need to specify the path to
cp by calling /bin/cp

Also you could try to set the PATH at the start of the script.  I have
noticed that cron does not use the path of the user.

- -- 
 Rev. LeRoy D. Cressy  mailto:leroy@lrcressy.com   /\_/\
                       http://lrcressy.com        ( o.o )
                       Phone:  215-535-4037        > ^ <
		       Cell:   267-307-3527

gpg fingerprint:  62DE 6CAB CEE1 B1B3 359A  81D8 3FEF E6DA 8501 AFEA

For info on enigmail:    http://lrcressy.com/linux/mozilla.pdf
For info on gpg:         http://www.gnupg.org/

Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me. (John 14:6)
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug