Sponsored Content
Full Discussion: Script Cron issue
Top Forums Shell Programming and Scripting Script Cron issue Post 302426167 by Segwar on Tuesday 1st of June 2010 03:17:51 AM
Old 06-01-2010
Script Cron issue

Hi All.

I have scheduled the script below in cron (Solaris 8). This script is supported to monitor the output of the websphere was-stat command and send a page out if it finds that one of the JVMs in the JVM_list.txt is down.
Code:
#!/bin/ksh
mailbox=pager_name
cat JVM_list.txt | while read i
do
was-stat | grep $i > /dev/null 2>&1
if [ $? -ne "0" ]; then
mailx -s "The JVM $i is down on server `hostname`" $mailbox
##echo "The JVM $i is down on server `hostname`"
else
echo " The JVM $i is up on the server `hostname`"
fi
done

The Cron entry is as follows
Code:
05 * * * 1-5 /path/to/script/jvmscript/server_name_jvm_monitor.sh > /dev/null 2>&1

The issue is that if I run the script interactively, it works.
but crontab does not seem to be initiating the script as I tried bringning a JVM down and I did not recieve a page.
The script is supposed to run every 5 mins on weekdays.
Can someone look at it and the script and help me debug.

Thanks
Segwar
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

cron issue

user x has a cron job that looks in a dir and moves teh files from 1 name to another except its not working correctly. . /user/.profile # sorce the users profile for file in `ls`; do mv $file $file.`date +%Y%m%d%H%M%S``microsec` done microsec is a binary with 555 perm. on it in... (5 Replies)
Discussion started by: Optimus_P
5 Replies

2. UNIX for Dummies Questions & Answers

Another Cron issue.

Hey guys, I have a script called my_test: # !/usr/bin/sh `touch /usr/test/me` The script has been saved in /usr/test/my_test I have executed chmod 755 /usr/test/my_test Then I have entered it into the cron file using crontab -e 0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/test/my_test... (2 Replies)
Discussion started by: Beefy
2 Replies

3. Solaris

Cron issue

When I list whats in cron -l its fine but when I try to -e edit it...it returns a number 309 can't you not edit cron this way with solaris 10? I can do it fine in sol 8 and 9. export EDITOR="vi" is set in my profile I am using BASH $ sudo crontab -l Password: #ident "@(#)root ... (5 Replies)
Discussion started by: kingdbag
5 Replies

4. Red Hat

cron issue

Hello, Having and issue with a job scheduled in cron. The script: #!/bin/bash 2 3 # Example shell script which can be added to roots cron job to check the 4 # Embedded Satellite disk space usage. If any table is over 90% usage, send 5 # a notice to the default email address... (2 Replies)
Discussion started by: mgb
2 Replies

5. Shell Programming and Scripting

issue invoking shell script using cron, even with proper file permission

I am using tcsh what could possibly be a problem, when using crontab to invoke a shell script. ? The script has the read, write and execute permission to all users. And the script works as expected while executing it in stand-alone mode. Is there a way to trace (like log) what error... (9 Replies)
Discussion started by: vikram3.r
9 Replies

6. UNIX for Advanced & Expert Users

Cron Issue

I have written a custom cron. This cron executes a rake task every 5 minutes. I also log the trace of this execution in a file locally on my server. The whole process seems to execute seamlessly every 5 minutes, but then it seems to log it in /var/log/syslog. I investigated on the syslog and found... (0 Replies)
Discussion started by: manjunath.nm89
0 Replies

7. UNIX for Dummies Questions & Answers

Cron Issue

I have written a custom cron. This cron executes a rake task every 5 minutes. I also log the trace of this execution in a file locally on my server. The whole process seems to execute seamlessly every 5 minutes, but then it seems to log it in /var/log/syslog. I investigated on the syslog and found... (0 Replies)
Discussion started by: manjunath.nm89
0 Replies

8. Ubuntu

Cron Issue

I have written a custom cron. This cron executes a rake task every 5 minutes. I also log the trace of this execution in a file locally on my server. The whole process seems to execute seamlessly every 5 minutes, but then it seems to log it in /var/log/syslog. I investigated on the syslog and found... (3 Replies)
Discussion started by: manjunath.nm89
3 Replies

9. Solaris

CRON Issue

Hello, I am running Solaris 8. I have set a cron job that runs every couple hours. If I run the script manually, it runs just fine (logged in as root). The cron however will not run. It is producing an rc=1 error. Any thoughts would be appreciated. Thanks (4 Replies)
Discussion started by: jkmtm
4 Replies

10. UNIX for Dummies Questions & Answers

Execution problem with Cron: Script works manually but not w/Cron. Why?

Hello gurus, I am making what I think is a simple db2 call from within a shell script but I am having difficulty producing the desired report when I run the script shown below from a shell script in cron. For example, my script and the crontab file setup is shown below: #!/bin/ksh db2... (3 Replies)
Discussion started by: okonita
3 Replies
wbemconfig(1M)						  System Administration Commands					    wbemconfig(1M)

NAME
wbemconfig - convert a JavaSpaces datastore to the newer Reliable Log datastore format SYNOPSIS
/usr/sadm/lib/wbem/wbemconfig convert DESCRIPTION
A Reliable Log directory is created that contains the converted data. This directory is named /var/sadm/wbem/logr. The convert argument is the only supported option of this command. You should only run this command after stopping WBEM (CIM Object Man- ager) with the init.wbem stop command. Otherwise your data may be corrupted. This command successfully converts any proprietary custom MOFs you have created in the datastore, but not any CIM or Solaris MOFs you have modified. These will be destroyed. To recompile any modified CIM or Solaris MOFs into the new datastore, run the mofcomp command on the MOF files containing the class definitions. Because the wbemconfig convert command invokes the JVM (Java Virtual Machine) to perform conversion of the JavaSpaces datastore, you must be running the same version of the JVM as when the original JavaSpaces storage was created. After the wbemconfig convert command is com- pleted, you can change to any version of the JVM you want. To see what version of the JVM you are running, issue the java -version command. OPTIONS
The following options are supported: convert Convert a JavaSpaces datastore to the newer Reliable Log datastore format. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWwbcou | +-----------------------------+-----------------------------+ SEE ALSO
init.wbem(1M), wbemadmin(1M), wbemlogviewer(1M), mofcomp(1M), attributes(5) SunOS 5.10 24 Aug 2000 wbemconfig(1M)
All times are GMT -4. The time now is 09:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy