|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQ 7.5 SaveQmgr automated |
« View previous topic :: View next topic » |
Author |
Message
|
MQ_Lover |
Posted: Mon Nov 11, 2013 10:07 am Post subject: MQ 7.5 SaveQmgr automated |
|
|
Acolyte
Joined: 15 Jul 2013 Posts: 67
|
Hi All,
I am trying to write a script for Windows to automate Queue Manager backup on a server but my lack of windows exposure is making me struggle. I have MQ 7.5..0.1 installed and I have written a basic script as below
set Today=%date:~0,2%_%date:~3,2%_%date:~6,4%
set QmgrName=TESTQMGR
dmpmqcfg -m %QmgrName% -o setmqaut > %QmgrName%.%Today%.Auth"
dmpmqcfg -m %QmgrName% -x object > "%QmgrName%.%Today%.MQSC"
So basically what happens with above is it gets file created with MQ objects and Authorizations having Date Stamp in it.
But, I am looking to automate the above fully like to have a generic script to run against all Queue Managers on that node rather than hardcoding the set QmgrName=TESTQMGR where TESTQMGR is the name of the Queue Manager running on that node.
I want to basically as we do in Linux have a script where the output of dspmq goes in a file and from their I could extract the Queue Manager name and pass it to the dmpmqcfg command, any help appreciated
Thanks |
|
Back to top |
|
 |
gbaddeley |
Posted: Mon Nov 11, 2013 2:20 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
Write the script in PowerShell or VB Script ? _________________ Glenn |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Nov 11, 2013 9:28 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Use For /F "usebackq token=*" %%I in (`dspmq-x `) DO (your code here) or something like it.
Note you may have to use setlocal enabledelayedexpansion ....
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|