nextcloudcmd.rst 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. The Nextcloud Client packages contain a command line client, ``nextcloudcmd``, that can
  2. be used to synchronize Nextcloud files to client machines.
  3. ``nextcloudcmd`` performs a single *sync run* and then exits the synchronization
  4. process. In this manner, ``nextcloudcmd`` processes the differences between
  5. client and server directories and propagates the files to bring both
  6. repositories to the same state. Contrary to the GUI-based client,
  7. ``nextcloudcmd`` does not repeat synchronizations on its own. It also does not
  8. monitor for file system changes.
  9. To invoke ``nextcloudcmd``, you must provide the local and the remote repository
  10. URL using the following command::
  11. nextcloudcmd [OPTIONS...] sourcedir nextcloudurl
  12. where ``sourcedir`` is the local directory and ``nextcloudurl`` is
  13. the server URL.
  14. Other command line switches supported by ``nextcloudcmd`` include the following:
  15. ``--user``, ``-u`` ``[user]``
  16. Use ``user`` as the login name.
  17. ``--password``, ``-p`` ``[password]``
  18. Use ``password`` as the password.
  19. ``-n``
  20. Use ``netrc (5)`` for login.
  21. ``--non-interactive``
  22. Do not prompt for questions.
  23. ``--silent``, ``--s``
  24. Inhibits verbose log output.
  25. ``--trust``
  26. Trust any SSL certificate, including invalid ones.
  27. ``--httpproxy http://[user@pass:]<server>:<port>``
  28. Uses ``server`` as HTTP proxy.
  29. ``--nonshib``
  30. Uses Non Shibboleth WebDAV Authentication
  31. ``--davpath [path]``
  32. Overrides the WebDAV Path with ``path``
  33. ``--exclude [file]``
  34. Exclude list file
  35. ``--unsyncedfolders [file]``
  36. File containing the list of un-synced remote folders (selective sync)
  37. ``--max-sync-retries [n]``
  38. Retries maximum n times (defaults to 3)
  39. ``-h``
  40. Sync hidden files, do not ignore them
  41. Credential Handling
  42. ~~~~~~~~~~~~~~~~~~~
  43. ``nextcloudcmd`` requires the user to specify the username and password using the standard URL pattern, e.g.,
  44. ::
  45. $ nextcloudcmd /home/user/my_sync_folder https://carla:secret@server/nextcloud/remote.php/webdav/
  46. To synchronize the Nextcloud directory ``Music`` to the local directory
  47. ``media/music``, through a proxy listening on port ``8080``, and on a gateway
  48. machine using IP address ``192.168.178.1``, the command line would be::
  49. $ nextcloudcmd --httpproxy http://192.168.178.1:8080 \
  50. $HOME/media/music \
  51. https://server/nextcloud/remote.php/webdav/Music
  52. ``nextcloudcmd`` will prompt for the user name and password, unless they have
  53. been specified on the command line or ``-n`` has been passed.
  54. Exclude List
  55. ~~~~~~~~~~~~
  56. ``nextcloudcmd`` requires access to an exclude list file. It must either be
  57. installed along with ``nextcloudcmd`` and thus be available in a system location,
  58. be placed next to the binary as ``sync-exclude.lst`` or be explicitly specified
  59. with the ``--exclude`` switch.