SUSE / openSUSEThis Forum is for the discussion of Suse Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have script to execute every five minutes, the script is fine when I execute manually, but when installed in crontab it is not working. I'm using SLES9.3
This is the crontab:
Code:
tplpga@plp-ftp:~/tganp/data/distribution> crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.21823 installed on Thu Feb 4 17:22:19 2010)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
# DO NOT EDIT THIS FILE - edit the master and reinstall.
*/5 * * * * /home/tplpga/bin/upload.ksh
This is the script:
Code:
tplpga@plp-ftp:~/tganp/data/distribution> cat /home/tplpga/bin/upload.ksh
#!/bin/ksh
# This script will call perl scripts from the NetPrice environment.
/home/tplpga/tganp/netpricescripts/bin/atpco_upload_asp --db tganp --verbose --tmp_dir /home/tplpga/tganp/data/log/distribution --carrier GA
No -- the usual issue, as mentioned in many of the LQ posts in the link, is that cron provides a different environment from the shell running in a terminal. Crucially $PATH is minimal; other factors also apply.
I have add upload.ksh in the path and installed it in crontab but it is still doesn't work. I even created one script to call upload.ksh and still no luck
Yes, I have execute the whole path to the command. But the problem had been solved. I just have to call .profile environment for the user. Thanks all for helping me out, really love LQ
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.