Create a file named something like enter_maintenance_mode.php and make it executable with
chmod a+x enter_maintenance_mode.php
Then put this inside that file. Replace your path with the paths included.
#!/usr/bin/env php
<?php
define('C5_EXECUTE', 1);
define('C5_ENVIRONMENT_ONLY', 1);
define('DIR_BASE', '/path/to/your/concrete5/install');
require('/path/to/your/concrete5/install/concrete/dispatcher.php');
Config::save('SITE_MAINTENANCE_MODE', 1);
Then to take it out of maintenance mode create a file named something like exit_maintenance_mode.php and make it executable with
chmod a+x exit_maintenance_mode.php
Then put this inside that file. Replace your path with the paths included.
#!/usr/bin/env php
<?php
define('C5_EXECUTE', 1);
define('C5_ENVIRONMENT_ONLY', 1);
define('DIR_BASE', '/path/to/your/concrete5/install');
require('/path/to/your/concrete5/install/concrete/dispatcher.php');
Config::save('SITE_MAINTENANCE_MODE', 0);
Then you can do some maintenance with your site in maintenance mode and pull it out when it's complete. For example you could create a file like do_maintenance.sh below.
#!/bin/bash
./enter_maintenance_mode.php
# do some scripting
./exit_maintenance_mode.php
Loading Conversation