LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Suse/Novell
User Name
Password
Suse/Novell This Forum is for the discussion of Suse Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 02-04-2010, 08:40 PM   #1
arfal
LQ Newbie
 
Registered: Aug 2009
Posts: 26

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: Slackware 13.37, Debian Squeeze
Posts: 7,963
Blog Entries: 25

Rep: Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006
Have a look here.
 
Old 02-05-2010, 01:31 AM   #3
arfal
LQ Newbie
 
Registered: Aug 2009
Posts: 26

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: Slackware 13.37, Debian Squeeze
Posts: 7,963
Blog Entries: 25

Rep: Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006
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
LQ Newbie
 
Registered: Aug 2009
Posts: 26

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: Slackware current
Posts: 8,457

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
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
LQ Newbie
 
Registered: Aug 2009
Posts: 26

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are 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


All times are GMT -5. The time now is 07:22 AM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration