Project

General

Profile

Owncloud cli cheatsheet » History » Version 6

Jessie Lee, 04/01/2016 01:21 PM

1 1 Jessie Lee
{{lastupdated_at}} by {{lastupdated_by}}
2
3
{{>toc}}
4
5
h1. Owncloud cli cheatsheet
6
7
h2. Architecture 
8
9
* Owncloud by default is installed to /var/www/owncloud
10
* The apache conf file is in /etc/apache2/conf-available/owncloud.conf
11
** by default this redirects any http[s[://[url]/owncloud to the owncloud directory
12
** I often change this to redirect / to owncloud if on subdomain or office fileserver
13
* owncloud config file is in /var/www/owncloud/config/config.php
14
** note: if setting changes in the config file do not take, check the permissions for this file
15
* the owncloud directory also has a detailed .htaccess file that is vital to the security of owncloud
16
* The data directory can be found in the config file and is also the location of the owncloud.log file
17
** the data directory can and at office servers is often supplemented or replaced by local storage or SMB
18 2 Jessie Lee
* the backend database is mysql which is used by default for everything.
19
** some larger installs (ex. NDWA) use redis instead of mysql for file locking. 
20
* caching is performed by memcached or redis
21 3 Jessie Lee
22
h2. OCC
23
24
Occ is the cli command tool for owncloud. Through this tool most user/file/maintenance operations can be performed. 
25
detailed instructions can be found here https://doc.owncloud.org/server/9.0/admin_manual/configuration_server/occ_command.html
26
27
key notes/favorite commands: 
28
29
* Occ must be run as the www-data user! 
30
** 8.0+ should no longer even allow running as root but if that happens there might be a permission mess to deal with!
31 6 Jessie Lee
** always use *sudo -u www-data php /var/www/owncloud/occ* (I have aliased this to occ)
32 4 Jessie Lee
* *occ upgrade* is needed for any major or minor release of owncloud!
33 3 Jessie Lee
** this will do a database upgrade test and then perform the upgrade
34
** for larger installs, this could take some time so only perform this during off hours. 
35 4 Jessie Lee
* *occ maintenance:mode --off/--on* this will gracefully close connections and turn on maintenance mode (or off)
36
* *occ file:scan [user]* this will rescan the file cache for [user] or --all for all
37 3 Jessie Lee
** this doesn't work for samba shares with OC login credentials as OC has no easy capacity for caching credentials for this purpose. (currently being worked on)
38 5 Jessie Lee
* *occ user:resetpassword [user]* will allow resetting a user password
39
* *occ user:lastseen [user]* will show when the user last logged in
40
* *occ user:report* will show a report of how many users are in the system
Go to top