nextcloudcmd.rst 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. Install ``nextcloudcmd``
  10. ~~~~~~~~~~~~~~~~~~~~~~~~
  11. CentOS
  12. ::
  13. $ sudo yum -y install epel-release
  14. $ sudo yum -y install nextcloud-client
  15. Ubuntu/Debian
  16. ::
  17. $ sudo add-apt-repository ppa:nextcloud-devs/client
  18. $ sudo apt update
  19. $ sudo apt install nextcloud-client
  20. Refer to the link
  21. - https://nextcloud.com/install/#install-clients
  22. - https://launchpad.net/~nextcloud-devs/+archive/ubuntu/client
  23. - https://pkgs.alpinelinux.org/packages?name=nextcloud-client
  24. - https://help.nextcloud.com/t/linux-packages-status/10216
  25. To invoke ``nextcloudcmd``, you must provide the local and the remote repository
  26. URL using the following command::
  27. nextcloudcmd [OPTIONS...] sourcedir nextcloudurl
  28. where ``sourcedir`` is the local directory and ``nextcloudurl`` is
  29. the server URL.
  30. Other command line switches supported by ``nextcloudcmd`` include the following:
  31. ``--path``
  32. Overrides default remote root folder to a specific subfolder on the server(e.g.: /Documents would sync the Documents subfolder on the server)
  33. ``--user``, ``-u`` ``[user]``
  34. Use ``user`` as the login name.
  35. ``--password``, ``-p`` ``[password]``
  36. Use ``password`` as the password.
  37. ``-n``
  38. Use ``netrc (5)`` for login.
  39. ``--non-interactive``
  40. Do not prompt for questions.
  41. ``--silent``, ``--s``
  42. Inhibits verbose log output.
  43. ``--trust``
  44. Trust any SSL certificate, including invalid ones.
  45. ``--httpproxy http://[user@pass:]<server>:<port>``
  46. Uses ``server`` as HTTP proxy.
  47. ``--exclude [file]``
  48. Exclude list file
  49. ``--unsyncedfolders [file]``
  50. File containing the list of un-synced remote folders (selective sync)
  51. ``--max-sync-retries [n]``
  52. Retries maximum n times (defaults to 3)
  53. ``-h``
  54. Sync hidden files, do not ignore them
  55. Credential Handling
  56. ~~~~~~~~~~~~~~~~~~~
  57. ``nextcloudcmd`` requires the user to specify the username and password using the standard URL pattern, e.g.,
  58. ::
  59. $ nextcloudcmd /home/user/my_sync_folder https://carla:secret@server/nextcloud
  60. To synchronize the Nextcloud directory ``Music`` to the local directory
  61. ``media/music``, through a proxy listening on port ``8080``, and on a gateway
  62. machine using IP address ``192.168.178.1``, the command line would be::
  63. $ nextcloudcmd --httpproxy http://192.168.178.1:8080 --path /Music \
  64. $HOME/media/music \
  65. https://server/nextcloud
  66. ``nextcloudcmd`` will prompt for the user name and password, unless they have
  67. been specified on the command line or ``-n`` has been passed.
  68. Exclude List
  69. ~~~~~~~~~~~~
  70. ``nextcloudcmd`` requires access to an exclude list file. It must either be
  71. installed along with ``nextcloudcmd`` and thus be available in a system location,
  72. be placed next to the binary as ``sync-exclude.lst`` or be explicitly specified
  73. with the ``--exclude`` switch.
  74. Example
  75. ~~~~~~~~~~~~
  76. - Synchronize a local directory to the specified directory of the nextcloud server
  77. ::
  78. $ nextcloudcmd --path /<Directory_that_has_been_created> /home/user/<my_sync_folder> \
  79. https://<username>:<secret>@<server_address>