Placing multiple domains into maintenance mode with one command

Ask questions about your setup or get help installing ZCS server (ZD section below).
Post Reply
csmallwood
Posts: 3
Joined: Tue Jul 17, 2018 2:26 pm
Location: Maryland
ZCS/ZD Version: 8.8.12

Placing multiple domains into maintenance mode with one command

Post by csmallwood »

I am currently running the 8.8.8_GA_2009.RHEL6_64_20180322150747 RHEL6_64 FOSS edition and I have 23 separate domains currently active on my server. I want to place them all in maintenance mode without running a command for each domain. I found the following command

Code: Select all

zmprov md <domain> zimbraDomainStatus maintenance
and tried it with regex by replacing the domain with '*.com" and it returns an error that says "No such domain *.com". Is there a way for me to place all of my domains into maintenance mode with one command? Thanks in advance.
User avatar
fs.schmidt
Outstanding Member
Outstanding Member
Posts: 278
Joined: Sat Sep 13, 2014 3:37 am
Location: Brazil
Contact:

Re: Placing multiple domains into maintenance mode with one command

Post by fs.schmidt »

Hi,

You can try to create a file with all your domains and run a single zmprov:

domains_maintenance.txt:

Code: Select all

md domain1.com zimbraDomainStatus maintenance
md domain2.com zimbraDomainStatus maintenance
md domain2.com zimbraDomainStatus maintenance
$ zmprov -f domains_maintenance.txt
csmallwood
Posts: 3
Joined: Tue Jul 17, 2018 2:26 pm
Location: Maryland
ZCS/ZD Version: 8.8.12

Re: Placing multiple domains into maintenance mode with one command

Post by csmallwood »

Thanks fs.schmidt, I'll try that. Appreciate your help.
Post Reply