2018-01-29 03:15:00 +03:00
|
|
|
The Nextcloud Client packages contain a command line client, ``nextcloudcmd``, that can
|
|
|
|
be used to synchronize Nextcloud files to client machines.
|
2015-04-24 21:34:20 +03:00
|
|
|
|
2018-01-29 03:15:00 +03:00
|
|
|
``nextcloudcmd`` performs a single *sync run* and then exits the synchronization
|
|
|
|
process. In this manner, ``nextcloudcmd`` processes the differences between
|
2015-04-24 21:34:20 +03:00
|
|
|
client and server directories and propagates the files to bring both
|
|
|
|
repositories to the same state. Contrary to the GUI-based client,
|
2018-01-29 03:15:00 +03:00
|
|
|
``nextcloudcmd`` does not repeat synchronizations on its own. It also does not
|
2015-04-24 21:34:20 +03:00
|
|
|
monitor for file system changes.
|
|
|
|
|
2020-05-27 13:03:23 +03:00
|
|
|
|
|
|
|
Install ``nextcloudcmd``
|
2021-04-19 10:32:53 +03:00
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~
|
2020-05-27 13:03:23 +03:00
|
|
|
|
|
|
|
CentOS
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
$ sudo yum -y install epel-release
|
|
|
|
$ sudo yum -y install nextcloud-client
|
|
|
|
|
2022-12-07 12:54:55 +03:00
|
|
|
Ubuntu
|
2020-05-27 13:03:23 +03:00
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
$ sudo add-apt-repository ppa:nextcloud-devs/client
|
|
|
|
$ sudo apt update
|
|
|
|
$ sudo apt install nextcloud-client
|
|
|
|
|
2022-12-07 12:54:55 +03:00
|
|
|
Debian
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
$ sudo apt install nextcloud-desktop-cmd
|
|
|
|
|
2020-05-27 13:03:23 +03:00
|
|
|
|
|
|
|
Refer to the link
|
|
|
|
|
|
|
|
- https://nextcloud.com/install/#install-clients
|
|
|
|
- https://launchpad.net/~nextcloud-devs/+archive/ubuntu/client
|
|
|
|
- https://pkgs.alpinelinux.org/packages?name=nextcloud-client
|
|
|
|
- https://help.nextcloud.com/t/linux-packages-status/10216
|
|
|
|
|
|
|
|
|
2018-01-29 03:15:00 +03:00
|
|
|
To invoke ``nextcloudcmd``, you must provide the local and the remote repository
|
2014-12-31 22:27:52 +03:00
|
|
|
URL using the following command::
|
2014-03-20 19:35:24 +04:00
|
|
|
|
2018-01-29 03:15:00 +03:00
|
|
|
nextcloudcmd [OPTIONS...] sourcedir nextcloudurl
|
2014-03-20 19:35:24 +04:00
|
|
|
|
2018-01-29 03:15:00 +03:00
|
|
|
where ``sourcedir`` is the local directory and ``nextcloudurl`` is
|
2014-06-26 00:04:33 +04:00
|
|
|
the server URL.
|
2014-03-20 19:35:24 +04:00
|
|
|
|
2018-01-29 03:15:00 +03:00
|
|
|
Other command line switches supported by ``nextcloudcmd`` include the following:
|
2014-03-20 19:35:24 +04:00
|
|
|
|
2023-10-09 05:34:40 +03:00
|
|
|
.. include:: ../doc/options-cmd.rst
|
2016-01-07 00:33:39 +03:00
|
|
|
|
2014-03-25 22:03:47 +04:00
|
|
|
Credential Handling
|
|
|
|
~~~~~~~~~~~~~~~~~~~
|
2014-03-20 19:35:24 +04:00
|
|
|
|
2018-01-29 03:15:00 +03:00
|
|
|
``nextcloudcmd`` requires the user to specify the username and password using the standard URL pattern, e.g.,
|
2017-03-20 17:48:24 +03:00
|
|
|
|
|
|
|
::
|
2014-03-20 19:35:24 +04:00
|
|
|
|
2021-08-20 18:46:38 +03:00
|
|
|
$ nextcloudcmd /home/user/my_sync_folder https://carla:secret@server/nextcloud
|
2014-03-25 22:03:47 +04:00
|
|
|
|
2018-01-29 03:15:00 +03:00
|
|
|
To synchronize the Nextcloud directory ``Music`` to the local directory
|
2014-09-18 13:36:02 +04:00
|
|
|
``media/music``, through a proxy listening on port ``8080``, and on a gateway
|
2014-06-26 00:04:33 +04:00
|
|
|
machine using IP address ``192.168.178.1``, the command line would be::
|
2014-03-25 22:03:47 +04:00
|
|
|
|
2021-08-20 18:46:38 +03:00
|
|
|
$ nextcloudcmd --httpproxy http://192.168.178.1:8080 --path /Music \
|
2014-03-25 22:03:47 +04:00
|
|
|
$HOME/media/music \
|
2021-08-20 18:46:38 +03:00
|
|
|
https://server/nextcloud
|
2014-03-25 22:03:47 +04:00
|
|
|
|
2018-01-29 03:15:00 +03:00
|
|
|
``nextcloudcmd`` will prompt for the user name and password, unless they have
|
2015-04-24 21:44:38 +03:00
|
|
|
been specified on the command line or ``-n`` has been passed.
|
2017-04-04 10:38:23 +03:00
|
|
|
|
|
|
|
Exclude List
|
|
|
|
~~~~~~~~~~~~
|
|
|
|
|
2018-01-29 03:15:00 +03:00
|
|
|
``nextcloudcmd`` requires access to an exclude list file. It must either be
|
|
|
|
installed along with ``nextcloudcmd`` and thus be available in a system location,
|
2017-04-04 10:38:23 +03:00
|
|
|
be placed next to the binary as ``sync-exclude.lst`` or be explicitly specified
|
|
|
|
with the ``--exclude`` switch.
|
2020-05-27 13:03:23 +03:00
|
|
|
|
|
|
|
Example
|
|
|
|
~~~~~~~~~~~~
|
|
|
|
|
|
|
|
- Synchronize a local directory to the specified directory of the nextcloud server
|
|
|
|
|
|
|
|
::
|
|
|
|
|
2021-08-20 18:46:38 +03:00
|
|
|
$ nextcloudcmd --path /<Directory_that_has_been_created> /home/user/<my_sync_folder> \
|
|
|
|
https://<username>:<secret>@<server_address>
|