• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Question Maintenance-Mode CLI

omexlu

Regular Pleskian
Hello,

What is the syntax to enable and disable the maintenance mode over SSH for a website?

And is it maybe necessary to 'sleep X' few seconds in a bash-script after the command?

Thanks in advance.
 
History of Changes

Code:
Websites maintenance mode

(*) subscription, site, subdomain utilities:
Deprecated option: -maintenance-mode. The Suspended website status is used instead (see the next change).

 

The Suspended status of websites

(*) subscription, site, subdomain utilities:
New command: --suspend.
 
Hello @IgorG

Thank you, what would be that command? Maybe to suspend multiple domains at once?
And a sleep X is needed maybe?

Thanks.
 
Maybe to suspend multiple domains at once?
Just use something like

# for i in `mysql -uadmin -p\`cat /etc/psa/.psa.shadow\` psa -Ns -e "select name from domains"`; do /usr/local/psa/bin/site --suspend $i; done
 
@IgorG

Hello,

This thread might be old but is it possible to disable more than 1 domain in one line like:
/usr/local/psa/bin/site --suspend domain1.tld domain2.tld

In this example maybe it is possible to avoid multiple services restarts?

Thanks.
 
is it possible to disable more than 1 domain in one line like
Try something like:

# for i in `mysql -uadmin -p\`cat /etc/psa/.psa.shadow\` psa -Ns -e "select name from domains"`; do /usr/local/psa/bin/site --suspend $i; done

statement "select name from domains" you can replace according to your needed conditions.
 
Try something like:

# for i in `mysql -uadmin -p\`cat /etc/psa/.psa.shadow\` psa -Ns -e "select name from domains"`; do /usr/local/psa/bin/site --suspend $i; done

statement "select name from domains" you can replace according to your needed conditions.

Thank you, but what if I don't want to take all domains from database and only need few specific domains?
 
OK I will give it a try, but is there not another possiblity without sql statement?

For a single domain it works without.

Thank you very much for always your help :)
 
what about create a textfile with the specified domain names you want one per line and write a script which read the textfile and do the requiered action/command per domain? There are a lot of examples around just google for it
 
Last edited:
Back
Top