Friday, March 7, 2008

Having fun with situations

Using the tacmd you can list, view, create, edit, delete and list situations. I have created a short and sweet script to dump and save all my current situations. I do this before I make any mass changes to the sits (e.g., change the RunOnStart=NO on all sits).

Here is a script I have created to backup all my situations before I make any mass changes to them.

#!/bin/sh
mkdir /tmp/dumpsits
cp dumpsits.tar dumpsitsOld.tar
tacmd listsit -n -d "," | \
while read line ; do
sitname=`echo "$line" | awk -F"," '{print $2}'`
tacmd viewsit -s $sitname -e /tmp/dumpsits/$sitname.out
done
tar -cvf dumpsits.tar /tmp/dumpsits
rm /tmp/dumpsits/*.*
rmdir /tmp/dumpsits

No comments: