Title: Activating maintenance mode from bash script
Last modified: September 18, 2023

---

# Activating maintenance mode from bash script

 *  Resolved [xonauqa](https://wordpress.org/support/users/xonauqa/)
 * (@xonauqa)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/activating-maintenance-mode-from-bash-script/)
 * Hi members,
 * I am very happy with the plugin, it works just fine when I activate it in the
   WP settings.
 * Now I would like to activate the maintenance mode from the shell (cron job with
   backup script), so that maintenance mode is active while the database is dumped.
 * Is there a command available, or do I have to create some file in some directory
   to activate the plugin?

Viewing 1 replies (of 1 total)

 *  Plugin Author [Alexandru Tapuleasa](https://wordpress.org/support/users/talextech/)
 * (@talextech)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/activating-maintenance-mode-from-bash-script/#post-17060709)
 * No, we don’t have wp-cli support. If you want to make your own file to enable
   it programatically it should be something like this, assuming WP core is loaded:
   `
   $settings = get_option('maintenance_options');$settings['state']=1;update_option('
   maintenance_options', $options);

Viewing 1 replies (of 1 total)

The topic ‘Activating maintenance mode from bash script’ is closed to new replies.

 * ![](https://ps.w.org/maintenance/assets/icon-256x256.png?rev=2689583)
 * [Maintenance](https://wordpress.org/plugins/maintenance/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/maintenance/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/maintenance/)
 * [Active Topics](https://wordpress.org/support/plugin/maintenance/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/maintenance/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/maintenance/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Alexandru Tapuleasa](https://wordpress.org/support/users/talextech/)
 * Last activity: [2 years, 8 months ago](https://wordpress.org/support/topic/activating-maintenance-mode-from-bash-script/#post-17060709)
 * Status: resolved