Unix/Linux Go Back    

Shell Programming and Scripting BSD, Linux, and UNIX shell scripting — Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.


Shell Programming and Scripting

Thread Tools Search this Thread Display Modes
Old Unix and Linux 08-21-2005   -   Original Discussion by maldini
maldini maldini is offline
Registered User
Join Date: Jul 2005
Last Activity: 20 January 2006, 4:30 AM EST
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts


I wrote scripting to perform some jobs. (eg, run_job)
Everything works ok when i tested it on my side.
I execute the run_job manually and it works perfectly ok.

When my administrator try to run it using a scheduler job.
He encountered problem of running it.
He said it might be due to we are using ksh.

Hence, i added #!/bin/ksh in front of my code.
But seems like my program will stop running at there once i hit that #!/bin/ksh code.
Anyone know why?

Sponsored Links
Old Unix and Linux 08-22-2005   -   Original Discussion by maldini
98_1LE 98_1LE is offline Forum Advisor  
Registered User
Join Date: Dec 2000
Last Activity: 21 May 2012, 6:37 PM EDT
Location: Greater Dallas area
Posts: 405
Thanks: 0
Thanked 3 Times in 3 Posts
Generally speaking when a script will run from the command line, but not from cron, it is an environment problem, often PATH. If your script is using environment variables, hard code them in the script and export them.

There is nothing wrong with ksh.

The easiest way to find the problem is to look at the output from the job. Normally this is mailed to the user than the job is running as, but you can also put this at the end of the crontab entry to log everything:
>/tmp/mycron.log 2>&1

If you are still having problems post the output and someone should be able to help.
Sponsored Links

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

All times are GMT -4. The time now is 04:22 PM.