• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

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