Using the occ command we can control Owncloud in many ways. Very useful for situations where you can’t access the web frontend due to a broken upgrade or application.
The occ command is available from Owncloud 7 and later.
To disable maintenance mode, from the ownCloud root folder we run:
sudo -u "webuser" ./occ maintenance:mode --off
And to turn it on we use:
sudo -u "webuser" ./occ maintenance:mode --on