{"id":1211,"date":"2022-06-28T17:45:11","date_gmt":"2022-06-28T09:45:11","guid":{"rendered":"https:\/\/www.cith.ml:5444\/?p=1211"},"modified":"2022-06-28T17:45:28","modified_gmt":"2022-06-28T09:45:28","slug":"nextcloud-occ-%e5%91%bd%e4%bb%a4","status":"publish","type":"post","link":"https:\/\/blog.cithwu.com\/wp5444\/nextcloud-occ-%e5%91%bd%e4%bb%a4\/","title":{"rendered":"Nextcloud OCC \u547d\u4ee4"},"content":{"rendered":"\n<pre class=\"wp-block-preformatted\">sudo -u www-data php occ #\u4ee5www-data\u7528\u6237\u8eab\u4efd\u6267\u884cOCC\u6587\u4ef6<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f1a\u8f93\u51fa\u4ee5\u4e0b\u5185\u5bb9\uff08\u4ee5Nextcloud\u4e3a\u4f8b\uff09\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Nextcloud version 11.0.1\n\nUsage:\n  command [options] [arguments]\n\nOptions:\n  -h, --help            Display this help message\n  -q, --quiet           Do not output any message\n  -V, --version         Display this application version\n      --ansi            Force ANSI output\n      --no-ansi         Disable ANSI output\n  -n, --no-interaction  Do not ask any interactive question\n      --no-warnings     Skip global warnings, show command output only\n  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug\n\nAvailable commands:\n  _completion                         BASH completion hook.\n  check                               check dependencies of the server environment\n  help                                Displays help for a command\n  list                                Lists commands\n  status                              show some status information\n  upgrade                             run upgrade routines after installation of a new release. The release has to be installed before.\n app\n  app:check-code                      check code to be compliant\n  app:disable                         disable an app\n  app:enable                          enable an app\n  app:getpath                         Get an absolute path to the app directory\n  app:list                            List all available apps\n background\n  background:ajax                     Use ajax to run background jobs\n  background:cron                     Use cron to run background jobs\n  background:webcron                  Use webcron to run background jobs\n config\n  config:app:delete                   Delete an app config value\n  config:app:get                      Get an app config value\n  config:app:set                      Set an app config value\n  config:import                       Import a list of configs\n  config:list                         List all configs\n  config:system:delete                Delete a system config value\n  config:system:get                   Get a system config value\n  config:system:set                   Set a system config value\n dav\n  dav:create-addressbook              Create a dav addressbook\n  dav:create-calendar                 Create a dav calendar\n  dav:sync-birthday-calendar          Synchronizes the birthday calendar\n  dav:sync-system-addressbook         Synchronizes users to the system addressbook\n db\n  db:convert-type                     Convert the Nextcloud database to the newly configured one\n  db:generate-change-script           generates the change script from the current connected db to db_structure.xml\n encryption\n  encryption:change-key-storage-root  Change key storage root\n  encryption:decrypt-all              Disable server-side encryption and decrypt all files\n  encryption:disable                  Disable encryption\n  encryption:enable                   Enable encryption\n  encryption:encrypt-all              Encrypt all files for all users\n  encryption:list-modules             List all available encryption modules\n  encryption:set-default-module       Set the encryption default module\n  encryption:show-key-storage-root    Show current key storage root\n  encryption:status                   Lists the current status of encryption\n federation\n  federation:sync-addressbooks        Synchronizes addressbooks of all federated clouds\n files\n  files:cleanup                       cleanup filecache\n  files:scan                          rescan filesystem\n  files:transfer-ownership            All files and folders are moved to another user - shares are moved as well.\n files_external\n  files_external:applicable           Manage applicable users and groups for a mount\n  files_external:backends             Show available authentication and storage backends\n  files_external:config               Manage backend configuration for a mount\n  files_external:create               Create a new mount configuration\n  files_external:delete               Delete an external mount\n  files_external:export               Export mount configurations\n  files_external:import               Import mount configurations\n  files_external:list                 List configured admin or personal mounts\n  files_external:notify               Listen for active update notifications for a configured external mount\n  files_external:option               Manage mount options for a mount\n  files_external:verify               Verify mount configuration\n group\n  group:adduser                       add a user to a group\n  group:list                          list configured groups\n  group:removeuser                    remove a user from a group\n integrity\n  integrity:check-app                 Check integrity of an app using a signature.\n  integrity:check-core                Check integrity of core code using a signature.\n  integrity:sign-app                  Signs an app using a private key.\n  integrity:sign-core                 Sign core using a private key.\n l10n\n  l10n:createjs                       Create javascript translation files for a given app\n log\n  log:file                            manipulate logging backend\n  log:manage                          manage logging configuration\n maintenance\n  maintenance:data-fingerprint        update the systems data-fingerprint after a backup is restored\n  maintenance:mimetype:update-db      Update database mimetypes and update filecache\n  maintenance:mimetype:update-js      Update mimetypelist.js\n  maintenance:mode                    set maintenance mode\n  maintenance:repair                  repair this installation\n  maintenance:singleuser              set single user mode\n  maintenance:update:htaccess         Updates the .htaccess file\n security\n  security:certificates               list trusted certificates\n  security:certificates:import        import trusted certificate\n  security:certificates:remove        remove trusted certificate\n trashbin\n  trashbin:cleanup                    Remove deleted files\n  trashbin:expire                     Expires the users trashbin\n twofactorauth\n  twofactorauth:disable               Disable two-factor authentication for a user\n  twofactorauth:enable                Enable two-factor authentication for a user\n user\n  user:add                            adds a user\n  user:delete                         deletes the specified user\n  user:disable                        disables the specified user\n  user:enable                         enables the specified user\n  user:info                           show user info\n  user:lastseen                       shows when the user was logged in last time\n  user:list                           list configured users\n  user:report                         shows how many users have access\n  user:resetpassword                  Resets the password of the named user\n  user:setting                        Read and modify user settings\n versions\n  versions:cleanup                    Delete versions\n  versions:expire                     Expires the users file versions<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728CentOS\u4e2d\uff0c\u547d\u4ee4\u662f\u8fd9\u6837\u7684\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo -u apache php occ<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u533a\u522b\u5c31\u662fUbuntu\u548cCentOS\u7684http\u670d\u52a1\u5668\u7528\u6237\u4e0d\u540c<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4f7f\u7528\u5b83\uff01<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">1\uff0c\u9047\u5230\u4e00\u4e2a\u65b0\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u6211\u4eec\u9996\u5148\u8981help\u4e00\u4e0b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo -u www-data php occ -h\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8f93\u51fa\u5982\u4e0b<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Usage:\n  help [options] [--] [&lt;command_name&gt;] #\u683c\u5f0f\uff1ahelp [\u9009\u9879] [--] [\u547d\u4ee4\u540d]\n\nArguments:\n  command               The command to execute \n  command_name          The command name [default: \"help\"] #\u547d\u4ee4\u540d\uff08\u5bf9\u5e94\u4f7f\u7528\u683c\u5f0f\u4e2d\u7684\u201c\u547d\u4ee4\u540d\u201d\uff09\n\nOptions: #\u9009\u9879\n      --format=FORMAT   The output format (txt, xml, json, or md) [default: \"txt\"] #\u8f93\u51fa\u683c\u5f0f\uff0c\u9ed8\u8ba4\u4e3atxt\uff0c\u4e0b\u6587\u4e2d\u6709\u8bb2\n      --raw             To output raw command help #\u8f93\u51fa\u539f\u59cb\u547d\u4ee4\u5e2e\u52a9\n  -h, --help            Display this help message #\u663e\u793a\u5e2e\u52a9\u4fe1\u606f\n  -q, --quiet           Do not output any message #\u4e0d\u8f93\u51fa\u4efb\u4f55\u4fe1\u606f\n  -V, --version         Display this application version #\u663e\u793a\u7a0b\u5e8f\u7248\u672c\n      --ansi            Force ANSI output #\u5f3a\u5236\u4f7f\u7528ANSI\u683c\u5f0f\u8f93\u51fa\n      --no-ansi         Disable ANSI output #\u7981\u7528ANSI\u8f93\u51fa\n  -n, --no-interaction  Do not ask any interactive question #\u4e0d\u8981\u8be2\u95ee\u4efb\u4f55\u95ee\u9898\uff08\u6240\u6709\u9009\u9879\u9ed8\u8ba4\uff0c\u5927\u6982\u8fd9\u4e2a\u610f\u601d\uff09\n      --no-warnings     Skip global warnings, show command output only #\u8df3\u8fc7\u9519\u8bef\u4fe1\u606f\n  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug\n# \u589e\u52a0\u6d88\u606f\u7684\u8be6\u7ec6\u7a0b\u5ea6\uff1a1\u7528\u4e8e\u6b63\u5e38\u8f93\u51fa\uff0c2\u7528\u4e8e\u66f4\u8be6\u7ec6\u7684\u8f93\u51fa\uff0c3\u7528\u4e8e\u8c03\u8bd5\nHelp:\n The help command displays help for a given command: #\u8be6\u7ec6\u5730\uff0c\u67e5\u770b\u4e00\u4e2a\u547d\u4ee4\u7684\u4f7f\u7528\u65b9\u6cd5\uff0c\u4f8b\u5982\uff1a\n \n   php occ help list\n \n You can also output the help in other formats by using the --format option:\n \n   php occ help --format=xml list\n \n To display the list of available commands, please use the list command.<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f7f\u7528-h\u9009\u9879\u83b7\u53d6\u4e00\u4e2a\u547d\u4ee4\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u6bd4\u5982\u6211\u8981\u67e5\u8be2maintenance:mode\uff08\u7ef4\u62a4\u6a21\u5f0f\uff09\u547d\u4ee4\u7684\u4f7f\u7528\u65b9\u5f0f<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8f93\u5165<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo -u www-data php occ help maintenance:mode<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">Usage:\n maintenance:mode [options] #\u683c\u5f0f\uff1a maintenance:mode+\u9009\u9879\uff08\u5373maintenance:mode\u540e\u9762\u8ddf\u9009\u9879\uff09\n\nOptions: #\u9009\u9879\uff08\u5bf9\u5e94\u4e0a\u9762\u683c\u5f0f\u4e2d\u7684\u201c\u9009\u9879\u201d\uff09\n     --on              enable maintenance mode #\u6fc0\u6d3b\u7ef4\u62a4\u6a21\u5f0f\n     --off             disable maintenance mode #\u5173\u95ed\u7ef4\u62a4\u6a21\u5f0f\n -h, --help            Display this help message #\u663e\u793a\u5e2e\u52a9\u4fe1\u606f\uff0c\u5373\u672c\u6bb5\u4fe1\u606f\n -q, --quiet           Do not output any message #\u4e0d\u8f93\u51fa\u4efb\u4f55\u4fe1\u606f\n -V, --version         Display this application version \n     --ansi            Force ANSI output\n     --no-ansi         Disable ANSI output\n -n, --no-interaction  Do not ask any interactive question\n     --no-warnings     Skip global warnings, show command output only\n -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output,\n                       2 for more verbose output and 3 for debug<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">2.\u663e\u793aownCloud\/Nextcloud\u7248\u672c<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ee5Ubuntu\u3001Nextcloud\u4e3a\u4f8b<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo -u www-data php occ -V #\u9009\u9879\u4e3a-V\uff0c\u6ce8\u610f\u5927\u5199\n  Nextcloud version 9.0.0 #Nextcloud\u7248\u672c\u4e3a 9.0.0<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">3.\u67e5\u8be2\u60a8\u7684Nextcloud\u670d\u52a1\u5668\u72b6\u6001<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo -u www-data php occ status\n  - installed: true #\u5b89\u88c5\u72b6\u6001\uff1a\u5df2\u5b89\u88c5\n  - version: 9.0.0.19 #\u7248\u672c\uff1a9.0.0.19\n  - versionstring: 9.0.0 #\u7248\u672c\u4e32\uff1a9.0.0\n  - edition: #\u53d1\u884c\u7248\u672c\uff0c\u793e\u533a\u7248\u4e0d\u663e\u793a\uff0c\u4f01\u4e1a\u7248\u53ef\u80fd\u4f1a\u663e\u793a<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">4.\u547d\u4ee4\u8f93\u51fa\u683c\u5f0f\uff0c\u53ef\u4ee5\u8f93\u51fatxt, xml, json\u6216 md\u683c\u5f0f\u7684\u4fe1\u606f<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6bd4\u5982\u4ee5json\u683c\u5f0f\u8f93\u51fa\u670d\u52a1\u5668\u72b6\u6001\u4fe1\u606f\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo -u www-data php occ status --output=json\n\n{\"installed\":true,\"version\":\"9.0.0.19\",\"versionstring\":\"9.0.0\",\"edition\":\"\"}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u6216\u8005\u4ee5json_pretty\u683c\u5f0f\u8f93\u51fa\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo -u www-data php occ status --output=json_pretty\n{\n   \"installed\": true,\n   \"version\": \"9.0.0.19\",\n   \"versionstring\": \"9.0.0\",\n   \"edition\": \"\"\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\uff08\u8fd9\u6837\uff0cOCC\u547d\u4ee4\u53ef\u4ee5\u4f5c\u4e3a\u4e00\u4e2aAPI\u6765\u4f7f\u7528\uff09<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">5.\u547d\u4ee4\u81ea\u52a8\u8865\u5168<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Nextcloud11\u540e\uff0cOCC\u547d\u4ee4\u53ef\u4ee5\u4f7f\u7528\u81ea\u52a8\u8865\u5168\u547d\u4ee4\uff0c\u4f60\u9700\u8981\u4ee5\u4e0b\u547d\u4ee4\u6765\u8bbe\u7f6e\u81ea\u52a8\u8865\u5168<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># BASH ~4.x, ZSH\nsource &lt;(\/var\/www\/html\/nextcloud\/occ _completion --generate-hook)\n\n# BASH ~3.x, ZSH\n\/var\/www\/html\/nextcloud\/occ _completion --generate-hook | source \/dev\/stdin\n\n# BASH (any version)\neval $(\/var\/www\/html\/nextcloud\/occ _completion --generate-hook)<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8bbe\u7f6e\u540e\uff0c\u53ea\u6709\u63d0\u4f9bOCC\u6587\u4ef6\u5b8c\u6574\u76ee\u5f55\uff08\u6bd4\u5982\/var\/www\/html\/nextcloud\/occ &lt;tab&gt;\uff09\u624d\u80fd\u4f7f\u7528\u81ea\u52a8\u8865\u5168\u3002\u5728&#8211;generate-hook\u4e4b\u540e\u6307\u5b9a&#8211;programm occ\uff0c\u4fbf\u53ef\u65e0\u9700\u5728\u5199\u5b8c\u6574\u76ee\u5f55\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u6837\uff0c\u5f53\u4f60\u4f7f\u7528OCC\u547d\u4ee4\u884c\u5de5\u5177\u65f6\uff0c\u6309\u4e0bTab\u952e\u4fbf\u53ef\u81ea\u52a8\u8865\u5168\u5269\u4f59\u7684\u547d\u4ee4\u5185\u5bb9\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\u8f93\u5165\nsudo -u www-data php occ sta\n\u6309Tab\u952e\uff0c\u547d\u4ee4\u81ea\u52a8\u8865\u5168\u4e3a\uff1a\nsudo -u www-data php occ status<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u63d2\u4ef6\uff08APP\uff09\u7ba1\u7406\u547d\u4ee4<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5217\u51fa\u3001\u6fc0\u6d3b\u7981\u7528\u63d2\u4ef6<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">app\napp:check-code check code to be compliant #\u68c0\u67e5\u4ee3\u7801\u662f\u5426\u5408\u6cd5\napp:disable disable an app #\u7981\u7528\u4e00\u4e2a\u63d2\u4ef6\uff08app\uff09\napp:enable enable an app #\u6fc0\u6d3b\u4e00\u4e2a\u63d2\u4ef6\napp:getpath Get an absolute path to the app directory #\u83b7\u53d6\u5e94\u7528\u7a0b\u5e8f\u76ee\u5f55\u7684\u7edd\u5bf9\u8def\u5f84\napp:list List all available apps #\u5217\u51fa\u6240\u6709\u53ef\u7528\u7684\u63d2\u4ef6<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u547d\u4ee4\u793a\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo -u www-data php occ app:list\nEnabled:\n  - activity: 2.4.1\n  - comments: 1.1.0\n  - dav: 1.1.1\n  - direct_menu: 0.10.0\n  - federatedfilesharing: 1.1.1\n  - federation: 1.1.1\n  - files: 1.6.1\n  - files_external: 1.1.2\n  - files_markdown: 1.0.0\n  - files_pdfviewer: 1.0.1\n  - files_sharing: 1.1.1\n  - files_texteditor: 2.2\n  - files_trashbin: 1.1.0\n  - files_versions: 1.4.0\n  - files_videoplayer: 1.0.0\n  - firstrunwizard: 2.0\n  - gallery: 16.0.0\n  - logreader: 2.0.0\n  - lookup_server_connector: 1.0.0\n  - nextcloud_announcements: 1.0\n  - notifications: 1.0.1\n  - password_policy: 1.1.0\n  - provisioning_api: 1.1.0\n  - serverinfo: 1.1.1\n  - sharebymail: 1.0.1\n  - survey_client: 0.1.5\n  - systemtags: 1.1.3\n  - theming: 1.1.1\n  - twofactor_backupcodes: 1.0.0\n  - updatenotification: 1.1.1\n  - user_saml: 1.2.2\n  - workflowengine: 1.1.1\nDisabled:\n  - admin_audit\n  - encryption\n  - external\n  - files_accesscontrol\n  - files_automatedtagging\n  - files_retention\n  - spreed\n  - spreedme\n  - templateeditor\n  - user_external\n  - user_ldap<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>sudo -u www-data&#46;&#46;&#46;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,9],"tags":[],"class_list":["post-1211","post","type-post","status-publish","format-standard","hentry","category-linux","category-9"],"_links":{"self":[{"href":"https:\/\/blog.cithwu.com\/wp5444\/wp-json\/wp\/v2\/posts\/1211","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.cithwu.com\/wp5444\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.cithwu.com\/wp5444\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.cithwu.com\/wp5444\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.cithwu.com\/wp5444\/wp-json\/wp\/v2\/comments?post=1211"}],"version-history":[{"count":1,"href":"https:\/\/blog.cithwu.com\/wp5444\/wp-json\/wp\/v2\/posts\/1211\/revisions"}],"predecessor-version":[{"id":1212,"href":"https:\/\/blog.cithwu.com\/wp5444\/wp-json\/wp\/v2\/posts\/1211\/revisions\/1212"}],"wp:attachment":[{"href":"https:\/\/blog.cithwu.com\/wp5444\/wp-json\/wp\/v2\/media?parent=1211"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.cithwu.com\/wp5444\/wp-json\/wp\/v2\/categories?post=1211"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.cithwu.com\/wp5444\/wp-json\/wp\/v2\/tags?post=1211"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}