Page 1 of 1

working on cluster service

Posted: 07 Nov 2013 10:30
by mor.bas
Hi,
I need a script to do the following flow:
1. get a list.txt file that have a list like this:
abc;tyservice
dfg;cyservice
2.It's ask how many node it have in cluster and put in a file (node.txt)
3.check about any res where is ruining and put in in file.(res.txt)
4.check about the service if it ruining in other node (that not is res.txt) and if it running there stop them.
Rifght know I have something like this:
>"node.txt" (
for /f "skip=4" %%i in ('cluster node') do echo %%i
)

for /f "tokens=1,2* delims=;" %%d in (C:\Servicelist.txt) do call:Finding "%%d" "%%e"

:Finding
>"res.txt" (
for /f "skip=5 tokens=4" %%i in ('cluster res "%1" /stat') do echo %%i
)
sc \\ query "service"|finstr /m "runing"
if %errorlevel%=0 then sc \\ stop

Can you help me to edit this to run completely good
?
Thanks in advance....

Re: working on cluster service

Posted: 10 Nov 2013 04:29
by mor.bas
any advice or response?