Using the s INT switch means the process will be send a SIGINT signal, the instance should save the data on the way down. If you kill the process with -9 then the process is sent a SIGKILL and the data will not be saved to disk.
The SIGINT signal is sent to a process by its controlling terminal when a user wishes to interrupt the process, this is comparable to stopping a service in windows
The SIGKILL signal is sent to a process to cause it to terminate immediately (kill). In contrast to SIGTERM and SIGINT, this signal cannot be caught or ignored, and the receiving process cannot perform any clean-up upon receiving this signal, this is comparable to ending a process in windows.
Can you try doing a save data from inside TM1 first and then seeing if the -s INT switch works in a more timely fashion?
If you're looking for a way to monitor whether the instance has come down properly then you can use the script /opt/ibm/tm1/bin64/status_tm1s.sh to check if the instance has come down yet. This is a script I use to restart and instance on our linux box using cron:\
Code: Select all
#!/bin/bash
# restartinstance.sh
#:${1?"Usage: $0 Instance_Name"}
if [ -z "$1" ] ; then
echo "Please specify an instance"
exit 1
fi
#this is needed to laod the environment variables needed for tm1 to run correctly
source /etc/profile.d/oracle11g.sh
source ~/.profile
#Set the instance name
instance=$1
configpath=/tm1/data/$instance/config/
echo "Shutting down instance " $instance
/opt/ibm/tm1/bin64/shutdown_tm1s.sh $configpath
while true; do
stillrunning=$(/opt/ibm/tm1/bin64/status_tm1s.sh $configpath )
if [ -n "$stillrunning" ]; then
sleep 5
echo "Instance " $instance " is still up"
else
echo "Instance is down"
sleep 15
mv /tm1/data/$instance/logging/tm1server.log /tm1/data/$instance/logging/tm1server-$(date +"%Y-%m-%d_%H%M").log
break
fi
done
echo " Starting up instance"
nohup /opt/ibm/tm1/bin64/startup_tm1s.sh $configpath &
disown
To set this up in cron, switch user to the user that the tm1 instances are running as, then run crontab -e to edit
This is what I have in my crontab
Code: Select all
MAILTO=""
30 4 * * * /tm1/data/scripts/restart_tm1s.sh arp > /dev/null 2>&1
I set the MAILTO variable to be empty so that the job doesn't try and email the user that it has run,
The next line sets the script to run at 04:30 everyday, sending the output of the script to null