Owncloud: Using the occ Command
occ: la commande d’administration de ownCloud
ownCloud’s occ
command
[ ATTRIBUTE: Please check: http://www.flickr.com/photos/91795203@N02/23828677959 to find out how to attribute this image]
ownCloud’s occ
command (ownCloud console) is ownCloud’s command-line interface. You can perform many common server operations with occ
:
* Manage apps
* Manage users
* Convert the ownCloud database
* Reset passwords, including administrator passwords
* Convert the ownCloud database from SQLite to a more performant DB
* Query and change LDAP settings
occ
is in the owncloud/
directory; for example /var/www/owncloud
on Ubuntu Linux. occ
is a PHP script. You must run it as your HTTP user to ensure that the correct permissions are maintained on your ownCloud files and directories.
The HTTP user is different on the various Linux distributions. See the Setting Strong Directory Permissions section of Installation Wizard to learn how to find your HTTP user.
- The HTTP user and group in Debian/Ubuntu is
www-data
. - The HTTP user and group in Fedora/CentOS is
apache
. - The HTTP user and group in Arch Linux is
http
. - The HTTP user in openSUSE is
wwwrun
, and the HTTP group iswww
.
Running it with no options lists all commands and options, like this example on Ubuntu:
$ sudo -u www-data php occ
ownCloud version 8.0.3
Usage:
[options] command [arguments]
Options:
--help (-h) Display this help message
--quiet (-q) Do not output any message
--verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal
output, 2 for more verbose output and 3 for debug
--version (-V) Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
--no-interaction (-n) Do not ask any interactive question
Available commands:
check check dependencies of the server environment
help Displays help for a command
list Lists commands
status show some status information
upgrade run upgrade routines after installation of a new
release. The release has to be installed before.
This is the same as sudo -u www-data php occ list
.
Run it with the -h
option for syntax help:
$ sudo -u www-data php occ -h
Display your ownCloud version:
$ sudo -u www-data php occ -V
ownCloud version 8.0.3
Query your ownCloud server status:
$ sudo -u www-data php occ status
- installed: true
- version: 8.0.3.4
- versionstring: 8.0.3
- edition: Enterprise
occ
has options, commands, and arguments. Options and arguments are optional, while commands are required. The syntax is:
occ [options] command [arguments]
Get detailed information on individual commands with the help
command, like this example for the maintenance:mode
command:
$ sudo -u www-data php occ help maintenance:mode
Usage:
maintenance:mode [--on] [--off]
Options:
--on enable maintenance mode
--off disable maintenance mode
--help (-h) Display this help message.
--quiet (-q) Do not output any message.
--verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal
output, 2 for more verbose output and 3 for debug
--version (-V) Display this application version.
--ansi Force ANSI output.
--no-ansi Disable ANSI output.
--no-interaction (-n) Do not ask any interactive question.
Apps Commands
The app
commands list, enable, and disable apps. This lists all of your installed apps, and shows whether they are enabled or disabled:
$ sudo -u www-data php occ app:list
Enable an app:
$ sudo -u www-data php occ app:enable external
external enabled
Disable an app:
$ sudo -u www-data php occ app:disable external
external disabled