Essential Commands for Managing Apps with 'occ' » History » Version 1
Gareth Eaton, 07/05/2023 11:49 AM
1 | 1 | Gareth Eaton | h1. Essential Commands for Managing Apps with 'occ' |
---|---|---|---|
2 | |||
3 | The sudo -u www-data php occ command in Nextcloud allows you to execute various administrative tasks and commands. Here are some common commands you can use with occ: |
||
4 | |||
5 | *occ app:list* : Lists all installed apps and their versions. |
||
6 | |||
7 | *occ app:enable <app_name>* : Enables a specific app. |
||
8 | |||
9 | *occ app:disable <app_name>* : Disables a specific app. |
||
10 | |||
11 | *occ app:update <app_name>* : Updates a specific app to the latest version. |
||
12 | |||
13 | *occ maintenance:mode --on* : Puts Nextcloud into maintenance mode, preventing user access. |
||
14 | |||
15 | *occ maintenance:mode --off* : Takes Nextcloud out of maintenance mode, allowing regular user access. |
||
16 | |||
17 | *occ db:add-missing-indices* : Adds missing database indices for performance optimization. |
||
18 | |||
19 | *occ db:convert-filecache-bigint* : Converts file cache to use bigint for large installations. |
||
20 | |||
21 | *occ config:system:set <parameter> --value=<value>* : Sets a configuration parameter with the specified value. |
||
22 | |||
23 | *occ config:system:get <parameter>* : Retrieves the value of a specific configuration parameter. |
||
24 | |||
25 | ---- |
||
26 | |||
27 | h3. *User Management:* |
||
28 | |||
29 | *occ user:list* : Lists all users in Nextcloud. |
||
30 | *occ user:add <username> --password=<password>* : Adds a new user. |
||
31 | *occ user:delete <username>* : Deletes a user. |
||
32 | *occ user:resetpassword <username>* : Resets the password for a user. |
||
33 | |||
34 | |||
35 | h3. *Group Management:* |
||
36 | |||
37 | *occ group:list* : Lists all groups in Nextcloud. |
||
38 | *occ group:add <groupname>* : Adds a new group. |
||
39 | *occ group:delete <groupname>* : Deletes a group. |
||
40 | *occ group:adduser <groupname> <username>* : Adds a user to a group. |
||
41 | *occ group:removeuser <groupname> <username>* : Removes a user from a group. |
||
42 | |||
43 | |||
44 | h3. *File Operations:* |
||
45 | |||
46 | *occ files:scan <user>* : Triggers a rescan of files for a specific user. |
||
47 | *occ files:cleanup* : Cleans up file versions and deleted files. |
||
48 | |||
49 | *Server Maintenance:* |
||
50 | |||
51 | *occ maintenance:repair* : Performs repair operations on the Nextcloud instance. |
||
52 | *occ maintenance:update:htaccess* : Updates the .htaccess file. |
||
53 | |||
54 | h3. *Logs and Debugging:* |
||
55 | |||
56 | *occ log:manage* : Manages log files. |
||
57 | *occ log:show <file>* : Displays the contents of a log file. |
||
58 | |||
59 | h3. *App Management:* |
||
60 | |||
61 | *occ app:check-code <app_name>* : Checks the code of an app for potential issues. |
||
62 | *occ app:install <app_name>* : Installs a specific app. |
||
63 | *occ app:uninstall <app_name>* : Uninstalls a specific app. |
||
64 | *occ app:enable <app_name>* : Enables a specific app. |
||
65 | *occ app:disable <app_name>* : Disables a specific app. |
||
66 | *occ app:update <app_name>* : Updates a specific app to the latest version. |
||
67 | |||
68 | *h3. Background Jobs:* |
||
69 | |||
70 | *occ background:webcron* : Executes Nextcloud background jobs via the webcron method. |
||
71 | *occ background:cron* : Executes Nextcloud background jobs via the system cron method. |
||
72 | |||
73 | h3. *Encryption and Security:* |
||
74 | |||
75 | occ encryption:enable: Enables server-side encryption. |
||
76 | occ encryption:disable: Disables server-side encryption. |
||
77 | occ encryption:scan: Scans and repairs encrypted files. |
||
78 | |||
79 | h3. *Sharing and Collaboration:* |
||
80 | |||
81 | *occ files:scan-app-data* : Rescans the app data folder. |
||
82 | *occ files:scan:all* : Rescans all files for all users. |
||
83 | *occ group:adduser <groupname> <username>* : Adds a user to a group. |
||
84 | *occ group:removeuser <groupname> <username>* : Removes a user from a group. |
||
85 | |||
86 | h3. *Database and Maintenance:* |
||
87 | |||
88 | *occ db:add-missing-indices* : Adds missing database indices for performance optimization. |
||
89 | *occ db:convert-filecache-bigint* : Converts file cache to use bigint for large installations. |
||
90 | *occ maintenance:mode --on* : Puts Nextcloud into maintenance mode. |
||
91 | *occ maintenance:mode --off* : Takes Nextcloud out of maintenance mode. |
||
92 | |||
93 | |||
94 | h3. *System Information and Status:* |
||
95 | |||
96 | *occ status* : Displays the system status and information. |
||
97 | *occ status --output=json* : Retrieves the system status in JSON format. |
||
98 | |||
99 | h3. *Theming and Customization:* |
||
100 | |||
101 | *occ config:system:set theme <theme_name>* : Sets the active theme for Nextcloud. |
||
102 | *occ config:system:set logo <path_to_logo>* : Sets a custom logo for Nextcloud. |
||
103 | *occ config:system:set background <path_to_background_image>* : Sets a custom background image for Nextcloud. |
||
104 | |||
105 | h3. *Collaborative Tags:* |
||
106 | |||
107 | *occ dav:sync-system-tags* : Synchronizes system tags across all files. |
||
108 | |||
109 | h3. *External Storage Management:* |
||
110 | |||
111 | *occ files_external:list* : Lists all external storage configurations. |
||
112 | *occ files_external:info <config_id>* : Displays information about a specific external storage configuration. |
||
113 | *occ files_external:create <backend> <config_id> <config_options>* : Creates a new external storage configuration. |
||
114 | *occ files_external:delete <config_id>* : Deletes an external storage configuration. |
||
115 | |||
116 | h3. *Configuring and Checking Integrity:* |
||
117 | |||
118 | *occ config:system:set <parameter> --value=<value>* : Sets a configuration parameter with the specified value. |
||
119 | *occ config:system:get <parameter>* : Retrieves the value of a specific configuration parameter. |
||
120 | *occ integrity:check-core* : Checks the integrity of Nextcloud core files. |