scripting out Integrty check and the result output
hi there,
I recently created a shell script to run the integrity check.
I used this as reference - Introduction | InterSystems IRIS Data Platform 2023.3
I found the example from above url having a line - "
kill ^IRIS.TempIntegrityOutput(+$job)
it isn't working when I used in a script. it returns the pid of my iris session instead.
I had to simplify the example to run following lines instead -
Do CheckList^Integrity(,,,,5)
do Display^Integrity(,1,)
script runs fine and can see integrity check results as expected.
however, the output seems cumulative, and output includes all historical run results as well.
I am new to InterSystems and wonder if you can share some experience how I can fix this issue.
thanks in advance,
Frank
As a guess the shell is interpreting $job rather than passing it to IRIS.
try this
echo 'set sc=$$CheckList^Integrity(,,,,5) do Display^Integrity() kill ^IRIS.TempIntegrityOutput(+$job)' | iris session [INSTANCE] -U %sys
one issue with this approach is you need to get the same IRIS session that the integrity check ran in.
thanks Alexander!
there is my function of the script, it worked just fine. I noticed that there is a mistake in my code that didnt remove the temp file as the results of the check, so every time the script runs, it will dump results into the same file and the file got send to me as email.
anyways, silly me and all fixed.
function integrityChk
{
# function to freeze the instance
echo 'set sc=$$CheckList^Integrity(,,,,5) do Display^Integrity(,1,) kill ^IRIS.TempIntegrityOutput(+$job)' | irissession $ENV -U%SYS
}
then passing the parameter to it to let it adapt to environment you want to run with
actually I have tried 2 ways to do this.
the other way isnt working.
function integrityChk
{
# function to freeze the instance
#/usr/bin/iris terminal $ENV -U%SYS "set sc=$$CheckList^Integrity(,,,,5)"
iris terminal $ENV -U%SYS << EOF
Do CheckList^Integrity(,,,,5)
do Display^Integrity(,1,)
EOF
}
any idea why this method not working?
It looks like you are missing the kill to cleanup.
kill ^IRIS.TempIntegrityOutput(+$job)
Something to know is you can pass a routine to IRIS but not a set. Look at the iris terminal options here.
yeah, since "kill ^IRIS.TempIntegrityOutput(+$job)" errors out in the function and I had to remove it.
anyways. thanks and will look into the link and learn more!