Many people are familiar with the problem of synchronizing files in their own private cloud with their local machine in a professional or private context. Often there are different sync clients for e.g. nextcloud or ownCloud for this… These save local copies of the files in the file system of the computer with which you synchronize. We had the problem that under our Linux workstations we found permanent authorization requests of the client in the browser. At least once a day… until we tried to extend the already existing rclone configuration with a nextcloud configuration.

To configure rclone on Arch Linux to connect to a Nextcloud instance and sync files, you’ll need to follow these step-by-step instructions. Rclone is a command-line program to manage files on cloud storage, and it’s quite versatile.

Before you begin, make sure you have Nextcloud set up and accessible, and you have administrative access to it.

To configure rclone on Arch Linux to connect to a Nextcloud instance and sync files, you’ll need to follow these step-by-step instructions. Rclone is a command-line program to manage files on cloud storage, and it’s quite versatile.

Before you begin, make sure you have Nextcloud set up and accessible, and you have administrative access to it.

Install rclone:

If you haven’t already installed rclone, you can do so using the package manager, Pacman:

sudo pacman -S rclone

Configure rclone:

Run the following command to configure rclone:

rclone config
  1. This will start the configuration process. Follow these steps:
    • Type n to create a new remote configuration.
    • Give your remote a name (e.g., „nextcloud“).
    • Choose the storage type. For Nextcloud, choose „webdav.“
    • For the Webdav URL, enter the URL of your Nextcloud instance. It typically looks like: https://your-nextcloud-domain/remote.php/webdav/. Replace your-nextcloud-domain with your actual domain.
    • For the vendor, choose „Other.“
    • Set User name to your Nextcloud username.
    • Set Password to your Nextcloud password.
    • Choose whether to encrypt your configuration. If you’re syncing sensitive data, it’s recommended to encrypt, but it’s optional.
    • Confirm your settings. If everything looks correct, type y to confirm.
  2. Test the connection:To ensure that your configuration is correct, run the following command to list the files on your Nextcloud:
rclone ls nextcloud:

Replace nextcloud with the name you gave your remote in step 2.

  1. Sync files:You can now start syncing files between your local system and Nextcloud using rclone. Here are some common commands:
    • To copy a local directory to Nextcloud:bashCopy coderclone copy /path/to/local/directory nextcloud:/path/on/nextcloud
    • To sync a local directory with Nextcloud (update changes in both directions):bashCopy coderclone sync /path/to/local/directory nextcloud:/path/on/nextcloud
    • To copy files from Nextcloud to your local system:bashCopy coderclone copy nextcloud:/path/on/nextcloud /path/to/local/directory
    You can schedule these commands as cron jobs to automate synchronization tasks.

Remember to replace /path/to/local/directory and /path/on/nextcloud with the actual paths you want to use. Be cautious when handling sensitive data and consider using encryption or other security measures if necessary.

What you also can do is to map nextcloud transparently as a fuse (file system in user space) to a given directory. That has the advantage that you can work with this like any local file system:

rclone --vfs-cache-mode writes mount "nextcloud": ~/Nextcloud >/dev/null &

The only thing that you’ll need to do is start this automatically once the interactive user session is started (either in Linux or Windows)

This also works (of course) with Windows. Just start a powershell script with the rclone command once you log in.

Replacing nextcloud client sync with rclone

Johannes Rest


.NET Architekt und Entwickler


Beitragsnavigation


Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert