Linux Format

CLI ADMINISTRA­TION

-

While Nextcloud has a well-rounded yet intuitive graphical interface, it also includes a powerful command line interface (CLI) that can be used to control all aspects of the installati­on. Nextcloud’s CLI is a PHP script that gets its name from its origins in owncloud and is called occ (for owncloud Console).

To use occ, move to the Nextcloud base directory (such as /var/ www/nextcloud), and then run it with the web server’s owner (usually www-data or apache) in order to maintain the correct permission­s on the Nextcloud files and folders. The sudo -u www-data php occ -V command fetches the version of the Nextcloud server you’re running. Using the list option such as sudo -u www-data php occ list displays all the supported commands and options. The occ equivalent of creating a new user is sudo -u www-data php occ user:add --display-name=”peter P.” --group=”it” peter , which creates a user named peter with the display name Peter P in the IT group of users.

You can use occ to streamline common administra­tion tasks. For example, the command sudo -u www-data php occ maintenanc­e:mode --on prevents users from logging into the server while you do maintenanc­e tasks on the installati­on, such as backups and upgrades. If your day job involves administer­ing a Nextcloud installati­on, it would be really beneficial if you spent some time familiaris­ing yourself with the occ CLI interface.

Newspapers in English

Newspapers from Australia