owncloud命令行工具
in Owncloud with 2 comments

owncloud命令行工具

in Owncloud with 2 comments

简介

ownCloud的occ命令(ownCloud控制台)是ownCloud的命令行界面。您可以执行许多常见的服务器操作,例如安装和升级ownCloud,管理用户,加密,密码,LDAP设置等。
occ在owncloud /目录中;例如Ubuntu Linux上的/ var / www / owncloud。
occ是一个PHP脚本。您必须以HTTP用户身份运行它,以确保您自己的Cloud文件和目录中保留正确的权限。在ownCloud
8.2+中,您可以从任何目录(指定文件路径)运行它;在以前的版本中,它必须从owncloud /目录运行。

使用

使用HTTP用户

首先查看apache/nginx的用户id。
apache:
Debian/Ubuntu 里的用户是 www-data
Fedora/CentOS 里的用户是 apache
Arch Linux 里的用户是 http
openSUSE 里的用户是wwwrun, 组是 www

nginx:
默认为nginx

比如我的nginx用户为www,执行id www

ooc1.jpg

然后vim /etc/passwd
找到你apache/nginx用户名所在的那行将/sbin/nologin更改为/bin/bash
然后执行su www
进入你的owncloud安装目录比如:cd /www/cloud/
occ2.jpg

使用

因为OOC由PHP编译生成,所以需要使用PHP命令来执行这个文件
执行php occ看到如下提示

bash-4.2$ php occ
ownCloud version 9.1.4

Usage:
  command [options] [arguments]

Options:
  -h, --help            Display this help message
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi            Force ANSI output
      --no-ansi         Disable ANSI output
  -n, --no-interaction  Do not ask any interactive question
      --no-warnings     Skip global warnings, show command output only
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

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.
 app
  app:check-code                      check code to be compliant
  app:disable                         disable an app
  app:enable                          enable an app
  app:getpath                         Get an absolute path to the app directory
  app:list                            List all available apps
 background
  background:ajax                     Use ajax to run background jobs
  background:cron                     Use cron to run background jobs
  background:webcron                  Use webcron to run background jobs
 config
  config:app:delete                   Delete an app config value
  config:app:get                      Get an app config value
  config:app:set                      Set an app config value
  config:import                       Import a list of configs
  config:list                         List all configs
  config:system:delete                Delete a system config value
  config:system:get                   Get a system config value
  config:system:set                   Set a system config value
 dav
  dav:create-addressbook              Create a dav addressbook
  dav:create-calendar                 Create a dav calendar
  dav:sync-birthday-calendar          Synchronizes the birthday calendar
  dav:sync-system-addressbook         Synchronizes users to the system addressbook
 db
  db:convert-type                     Convert the ownCloud database to the newly configured one
  db:generate-change-script           generates the change script from the current connected db to db_structure.xml
 encryption
  encryption:change-key-storage-root  Change key storage root
  encryption:decrypt-all              Disable server-side encryption and decrypt all files
  encryption:disable                  Disable encryption
  encryption:enable                   Enable encryption
  encryption:encrypt-all              Encrypt all files for all users
  encryption:list-modules             List all available encryption modules
  encryption:set-default-module       Set the encryption default module
  encryption:show-key-storage-root    Show current key storage root
  encryption:status                   Lists the current status of encryption
 federation
  federation:sync-addressbooks        Synchronizes addressbooks of all federated clouds
 files
  files:cleanup                       cleanup filecache
  files:scan                          rescan filesystem
  files:transfer-ownership            All files and folders are moved to another user - shares are moved as well.
 integrity
  integrity:check-app                 Check integrity of an app using a signature.
  integrity:check-core                Check integrity of core code using a signature.
  integrity:sign-app                  Signs an app using a private key.
  integrity:sign-core                 Sign core using a private key.
 l10n
  l10n:createjs                       Create javascript translation files for a given app
 log
  log:manage                          manage logging configuration
  log:owncloud                        manipulate ownCloud logging backend
 maintenance
  maintenance:data-fingerprint        update the systems data-fingerprint after a backup is restored
  maintenance:mimetype:update-db      Update database mimetypes and update filecache
  maintenance:mimetype:update-js      Update mimetypelist.js
  maintenance:mode                    set maintenance mode
  maintenance:repair                  repair this installation
  maintenance:singleuser              set single user mode
  maintenance:update:htaccess         Updates the .htaccess file
 security
  security:certificates               list trusted certificates
  security:certificates:import        import trusted certificate
  security:certificates:remove        remove trusted certificate
 sharing
  sharing:cleanup-remote-storages     Cleanup 'shared::' storage entries that have no matching entries in the shares_external table
 trashbin
  trashbin:cleanup                    Remove deleted files
  trashbin:expire                     Expires the users trashbin
 twofactorauth
  twofactorauth:disable               Disable two-factor authentication for a user
  twofactorauth:enable                Enable two-factor authentication for a user
 user
  user:add                            adds a user
  user:delete                         deletes the specified user
  user:disable                        disables the specified user
  user:enable                         enables the specified user
  user:lastseen                       shows when the user was logged in last time
  user:report                         shows how many users have access
  user:resetpassword                  Resets the password of the named user
 versions
  versions:cleanup                    Delete versions
  versions:expire                     Expires the users file versions

最后

很多命令都还没研究,刚刚接触,以后再补完吧。

Responses
icon_mrgreen.gificon_neutral.gificon_twisted.gificon_arrow.gificon_eek.gificon_smile.gificon_confused.gificon_cool.gificon_evil.gificon_biggrin.gificon_idea.gificon_redface.gificon_razz.gificon_rolleyes.gificon_wink.gificon_cry.gificon_surprised.gificon_lol.gificon_mad.gificon_sad.gificon_exclaim.gificon_question.gif
  1. 小可爱

    Reply
    1. @小可爱

      说的啥(:◎)≡

      Reply