• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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