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...


-----BEGIN PGP SIGNED MESSAGE-----
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)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJL2ucBAAoJEKuxGqN1iGbb1UsIAIy2pS7JoG68KT3dRAlDMLau
rxpPjUr6hkl3MCpd28LvK0+57MdvM0fZCKlU0EKXZvb1E6t/yUHXneGfqBiXlsu6
fqa/fxrH7fyburR88mnTyKSNP0aoZ7l3IcgnVBLai5qarAs06do5g9iNzYHXPEKf
4NnMz2SJgGnAxEkaap5SIN6/5fWybivFV9jfF6ZYrGZRQ8GAnv07+v3NQj7g6IMl
tvuJM/xlCh9UFhYA7uQCl48bZnep15dOfU9Iv1PgOqBvXDm42l95l5XrcCfifqkQ
aekQ//VsxUt4dV6K/VibGI9elrvsPgErEuszPb/PT0HjbYLDilFCbNz3mA4EjD8=
=+h13
-----END PGP SIGNATURE-----
___________________________________________________________________________
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