Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic SYNERGY (steve huntington)
Decrease font size
Increase font size
Topic Title: ccm repair script
Topic Summary: ccm repair cron fails
Created On: 7-Jul-2006 14:56
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 7-Jul-2006 14:56
User is offline View Users Profile Print this message


Dan Schulz

Posts: 9
Joined: 23-Jan-2006

I have the following ksh that runs weekly, but keeps failing with the following error!

Usage: ccmdb repair <database_path> -t|-repair_index <tablename>|<indexname>|<"">[-y]
or
ccmdb repair <database_path> -t|-repair_table <tablename> [-y]

===========
The script is as follows:

=======================================
#!/usr/bin/ksh
#
# Program: ccm.repair_index
#
#
# VARIABLES DECLARATION
#
export CCM_HOME=/usr/local/ccm63
export PATH=$PATH:$CCM_HOME/bin:/bin:/usr/bin:/usr/local/bin:/etc
export database_dir="/data/ccm_db"
export script_dir="/home/ccm_root/Scripts"

#
# FUNCTIONS DECLARATION
#
function start
{
             $script_dir/start_session $1                # this starts the ccm database session

             echo "">> .status
             echo "">> .status
}

function end
{
             $script_dir/stop_session                    # this stops the ccm database session
}

function repair_index
{
             ccmdb repair $1 -repair_index ""

             if [ "$?" -eq 0 ]
             then
                   echo repair_index check on $1 ran successfully
             else
                   echo repair_index check on $1 failed
             fi
}

#
# MAIN PROGRAM
#

date > .status
ls $database_dir | while read database
   do
     if [ $database != "lost+found" ]
     then

             echo "*********************************************" >> .status
             echo "">> .status
             start ${database} >> .status
             ccmdb repair ${database} -repair_index >> .status
             end >> .status
       fi
done

cat .status >> /data/ccm_log/repair_index`date'+%%Y%%m%d'`.log

#
# CLEANUP
#
rm .status
find /data/ccm_log -atime +30 -name "repair_index" -exec rm {}\;

======================================================================
Any comments, suggestions, for this script would be greatly appreciated...... 

This is a Script that runs in a crontab at 12:00am every Sunday after the fscheck script.

Thanks in advance....... 


Cheers.....


Dan Schulz
Computer Systems Analyst - EKM
Communications Security Establishment.
Ottawa, Ontario.

Dan.Schulz@cse-cst.gc.ca

 
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic SYNERGY forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 15:34.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.