Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Error while running the script through cron jobs .Please help me on this Post 302241760 by Sheethal on Tuesday 30th of September 2008 07:06:23 AM
Old 09-30-2008
Error while running the script through cron jobs .Please help me on this

Hi Everyone,

I have written a korn shell script to shutdown my documentum docbase server and to restart it automatically on a weekly basis. My script is,

Quote:
#!/bin/ksh
DM_DBA=/apps/doc/dba
cd $DM_DBA

logfile=/apps/doc/log/cleanup.log
df -k >> $logfile

#shut down Elegacy
./dm_shutdown_elegacy >> $logfile
status=$?
if [ ! $status = 0 ] ; then
cat <<-END >> $logfile
***** ERROR DURING Elegacy SHUTDOWN *****
********The elegacy dmshutdown utility reported a non-zero status **********
END
fi

#starting ewspg
./dm_start_ewspg >>$logfile
status=$?
if [ ! $status = 0 ] ; then
cat <<-END >> $logfile
***** ERROR DURING EWSPG STARTUP *****
********The ewspg start utility reported a non-zero status **********
END
fi
When i execute this script manually, i was able to execute it successfully without any issues. I have scheduled this script in cronjob to run once in a week.

when this script is run through cronjobs, I am getting the error while executing the statement,

Quote:
./dm_shutdown_elegacy >> $logfile
Quote:
Error Message:
Stopping Documentum server for docbase: [elegacy]
Connecting to Server using docbase elegacy
[DM_DOCBROKER_E_DMCL_INI_UNIX_MISSING]error: "Failure to connect to DocBroker (no dmcl.ini). The search rules are: 1) $DMCL_CONFIG specifies a file 2) current directory 3) $DOCUMENTUM specifies a directory with dmcl.ini."

Could not connect

***** /apps/doc/dm_shutdown_elegacy: ERROR
***** Unable to complete shutdown - unable to connect
***** to the server to issue shutdown request.

***** ERROR DURING Elegacy SHUTDOWN *****
********The elegacy dmshutdown utility reported a non-zero status **********
Here the "dm_shutdown_elegacy" is a Bourne shell script which performs the shutdown operation. The same script is running successfuly when i execute it manually, so from seeing the error message, I guess there could be two options for this error message.

1) The error message says, that it was not able find the value for the environment variables $DMCL_CONFIG and $DOCUMENTUM.
Can some one tell me that whether the cronjob uses different environment variables rather than using the user account environment variables? If so can you please tell me how to export the environment variables which have been set for my user account.
The environment variables DMCL_CONFIG, DOCUMENTUM have been set for my user account

2) I am trying to execute Bourne shell script from a korn shell script will that be a problem ? Can you please tell me is it the correct way?


Please help me on this.

Thanks in advance.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

running cron jobs

Hi, I'm new to cron and I would like to know if this cron entry looks right. Every monday to friday, at 9:15 AM execute the script called done_att.sh Every monday to friday, at 3:15 PM execute the script called start_att.sh 15 09 * * /u54/jobs/done_att.sh 45 15 * *... (1 Reply)
Discussion started by: ted
1 Replies

2. UNIX for Dummies Questions & Answers

running cron jobs

I would like to add a job using cron. I have following questions - cron jobs are launched using what login-id e.g. is the script launced using my login-id - In which directory would the cron jobs be launched ? - where do the environment variables required in the script being lauched come... (3 Replies)
Discussion started by: sharanbr
3 Replies

3. UNIX for Dummies Questions & Answers

How to tell which cron jobs are still running?

I have some cron jobs that are taking a might long time. That is because they are screen scrapers and I inserted an extra long pause (10 minutes between screens) to be extra polite and minimize network traffic. I was going to have them run once a day but now I'm thinking once a week. How do I... (2 Replies)
Discussion started by: siegfried
2 Replies

4. UNIX for Advanced & Expert Users

Seriously, cron jobs not running.

Before I get a million and one suggestions on all the things that could be wrong with my scripts - let me assure everyone that this is not the issue. i have a RH EL ES4 server that stopped running all cron jobs except hourly, daily, weekly. This has affected all users including root. No... (7 Replies)
Discussion started by: bill_k_Lopez
7 Replies

5. OS X (Apple)

cron jobs running, but not...

I have a cron job set up to run a script on my Leopard Server every night. The job is set up as root, and when I run the script manually, it runs fine. The problem is that it is not doing anything when it runs at night. In the cron log, it says it ran, but did not output the results to the file it... (3 Replies)
Discussion started by: yodomino6
3 Replies

6. Shell Programming and Scripting

Cron Jobs Still Running In Backgound

Hi guys, I've got a few cron jobs ... porblem is they are running as intended but some of them just tend to stay there in sleeping mode for quite some time ... sometimes even days ... for example when i run the ps command i can see that some are still there although the same script had run many... (6 Replies)
Discussion started by: King Nothing
6 Replies

7. Solaris

cron jobs not running from sudo

Hi, I am logging into sun solaris unix box as asood user.Then sudo su_appssu and scheduled my cron jobs.The user appssu is there In the /etc/cron.d/cron.allow . I do not understand why the jobs are not kicking by cron. Do I need to enter directly as appssu ? Regards Megh (10 Replies)
Discussion started by: megh
10 Replies

8. Shell Programming and Scripting

Running Cron -- same time jobs

Hi Is it possible to run different cron jobs at the same time? It appears that when I run ones at 15 min granularity that they may prevent ones running later in the day. Should crons run at same time have impact on one another? (4 Replies)
Discussion started by: rob171171
4 Replies

9. Red Hat

cron jobs not running during certain window

Hi unix.com, I'm currently experiencing a problem on one of our servers at work where between the hours of approx. 1:00 AM and 2:0 AM no jobs scheduled through cron run. Now, in the cron logs I do see that all jobs are launched and I'm not seeing any errors anywhere - but - none of the jobs... (2 Replies)
Discussion started by: tunachamp
2 Replies

10. UNIX for Beginners Questions & Answers

Cron jobs not running on time

on linux redhat, ubuntu systems, what reason would there be for a cron job not running at exactly the time it was scheduled to run, everytime? meaning, if i put something in cron to run every 120 seconds (2 minutes), why is it that some times, i find that cron would sometimes run the job a few... (1 Reply)
Discussion started by: SkySmart
1 Replies
SERVICE(8)						      System Manager's Manual							SERVICE(8)

NAME
service - run a System V init script SYNOPSIS
service SCRIPT COMMAND [OPTIONS] service --status-all service --help | -h | --version DESCRIPTION
service runs a System V init script or systemd unit in as predictable an environment as possible, removing most environment variables and with the current working directory set to /. The SCRIPT parameter specifies a System V init script, located in /etc/init.d/SCRIPT, or the name of a systemd unit. The existence of a systemd unit of the same name as a script in /etc/init.d will cause the unit to take precedence over the init.d script. The supported val- ues of COMMAND depend on the invoked script. service passes COMMAND and OPTIONS to the init script unmodified. For systemd units, start, stop, status, and reload are passed through to their systemctl/initctl equivalents. All scripts should support at least the start and stop commands. As a special case, if COMMAND is --full-restart, the script is run twice, first with the stop command, then with the start command. service --status-all runs all init scripts, in alphabetical order, with the status command. The status is [ + ] for running services, [ - ] for stopped services and [ ? ] for services without a status command. This option only calls status for sysvinit jobs. EXIT CODES
service calls the init script and returns the status returned by it. FILES
/etc/init.d The directory containing System V init scripts. /{lib,run,etc}/systemd/system The directories containing systemd units. ENVIRONMENT
LANG, LANGUAGE, LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES, LC_PAPER, LC_NAME, LC_ADDRESS, LC_TELEPHONE, LC_MEA- SUREMENT, LC_IDENTIFICATION, LC_ALL, TERM, PATH The only environment variables passed to the init scripts. SEE ALSO
/etc/init.d/skeleton update-rc.d(8) init(8) invoke-rc.d(8) systemctl(1) AUTHOR
Miloslav Trmac <mitr@redhat.com>, Petter Reinholdtsen <pere@hungry.com> Licence: GNU Public Licence v2 (GPLv2) COPYRIGHT
2006 Red Hat, Inc., Petter Reinholdtsen <pere@hungry.com> Jan 206 SERVICE(8)
All times are GMT -4. The time now is 09:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy