![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| problem with cron job | solne | SUN Solaris | 7 | 01-18-2008 04:57 PM |
| cron problem! | blowtorch | UNIX for Advanced & Expert Users | 4 | 03-07-2006 09:12 PM |
| Problem with cron | jhansrod | AIX | 2 | 11-25-2005 12:30 PM |
| cron problem | VPN | UNIX for Dummies Questions & Answers | 2 | 04-16-2004 03:27 AM |
| Cron Problem | Raiden | Shell Programming and Scripting | 4 | 11-16-2003 03:00 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Cron problem?
here's the scoop..
I have a ksh shell script written, that when I run it manually, it works wonderful, when I let it run via cron, it runs (tells me I have it set up correctly) but yet it doesn't run correctly (it only runs part of the commands with the script). what gives? I've got the #!/bin/ksh thing in the begining of my script.... thanks in advance! Todd |
| Forum Sponsor | ||
|
|
|
|||
|
If you suspect a possible environment issue, try turning on xtrace ("#/bin/ksh -x") mode inside of your script and letting cron run it. All the trace will then be mailed to you by the cron scheduler. Examining that may show you what is the issue.
Alternatively you can have the cron dump all "visible" output to a couple of log files. #cron entry 01 * * * * /scriptpath/script >/logs/good.out 2>/logs/badout (substitute the appropriate schedule of course) Lastly, unless your .profile has some interactive (requires responses from you) elements you could always source that at the beginning of your script #!/bin/ksh #capture any command line params first some_var=$1 # etc . ${HOME}/.profile (is what I do for most of my scripts at work) That way the environment is the same under cron and when you run it manually. Just suggestions Good luck. |