LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 02-04-2010, 08:40 PM   #1
arfal
Member
 
Registered: Aug 2009
Posts: 30

Rep: Reputation: 0
Crontab is not working, the script is working


Hi All,

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
Any solution?
 
Old 02-04-2010, 10:35 PM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Have a look here.
 
Old 02-05-2010, 01:31 AM   #3
arfal
Member
 
Registered: Aug 2009
Posts: 30

Original Poster
Rep: Reputation: 0
is the .ksh and .sh have different command to execute in crontab?
 
Old 02-05-2010, 01:36 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
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.
 
Old 02-07-2010, 08:35 PM   #5
arfal
Member
 
Registered: Aug 2009
Posts: 30

Original Poster
Rep: Reputation: 0
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
 
Old 02-08-2010, 01:39 AM   #6
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
The best way is to give the whole path to all the commands and files in the scripts
 
Old 02-08-2010, 08:48 PM   #7
arfal
Member
 
Registered: Aug 2009
Posts: 30

Original Poster
Rep: Reputation: 0
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell script not working through crontab paragkalra *BSD 1 04-15-2009 12:36 PM
Crontab not working Zeno McDohl Linux - Newbie 4 10-08-2008 05:55 PM
Crontab not working Zeno McDohl Linux - Newbie 1 06-05-2007 06:52 PM
Crontab Not working appropriate? roclok Linux - Software 9 06-15-2006 11:34 PM
crontab nor working navaladi Mandriva 11 01-17-2005 06:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 12:44 AM.

Main Menu
Advertisement
My LQ
Write for 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.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration