ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General IBM MQ Support » MQ 7.5 SaveQmgr automated

Post new topic  Reply to topic
 MQ 7.5 SaveQmgr automated « View previous topic :: View next topic » 
Author Message
MQ_Lover
PostPosted: Mon Nov 11, 2013 10:07 am    Post subject: MQ 7.5 SaveQmgr automated Reply with quote

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
View user's profile Send private message
gbaddeley
PostPosted: Mon Nov 11, 2013 2:20 pm    Post subject: Reply with quote

Jedi Knight

Joined: 25 Mar 2003
Posts: 2538
Location: Melbourne, Australia

Write the script in PowerShell or VB Script ?
_________________
Glenn
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Nov 11, 2013 9:28 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » MQ 7.5 SaveQmgr automated
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.