working on cluster service

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
mor.bas
Posts: 66
Joined: 25 Apr 2012 04:28

working on cluster service

#1 Post by mor.bas » 07 Nov 2013 10:30

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....

mor.bas
Posts: 66
Joined: 25 Apr 2012 04:28

Re: working on cluster service

#2 Post by mor.bas » 10 Nov 2013 04:29

any advice or response?

Post Reply