Rclone from CLI to GUI

Rclone is a powerful tool for syncing data to and from cloud storage. For everyday usability a graphical interface is nice. For the use case of encrypted offsite backup, a graphical user interface to access single files for restore makes it so much more usable. As an example, in this article, I will use the case of encrypted backup to Google drive. In that case, we encrypt all the data including filenames before uploading the data. That prevents us from browsing the backup on Google drive to retrieve a specific file that we need to restore. For this purpose, we could use the Rclone CLI but it will be much easier with a nice web UI.

Serving the UI

Rclone comes with a web UI that it can serve itself. As of writing this, it’s still in beta but it serves our purpose for this setup just fine. We will use the already created configuration from the Encrypted offsite backup article. Since we are using an existing configuration we have to enable authentication for the web UI.

rclone rcd --rc-web-gui --rc-user test --rc-pass secret

This command will launch the web UI with the login test and password secret. It will use the current configuration and let you browse the backends you already setup. From the Encrypted offsite backup example we can now navigate to Explorer and under Remotes start typing ENCGDrive and click open. This will show you all the files and folders with transparent encryption and let you download files. There are several options for authentication and SSL encryption that you can find here https://rclone.org/gui/.

Remote control

The web UI uses Rclone remote control to perform different actions like move, copy and download. One function that isn’t supported in the UI, at least not at the time of writing this article, is sync. Since this use case is for remote backups we want to automate it while still being able to monitor progress from the web UI dashboard. We can do this by issuing remote commands to the Rclone instance serving the web UI.

rclone rc config/listremotes --rc-user=test --rc-pass=secret

As a first example lets list the remotes. We need to include the username and password set for the remote instance. The remote uses a simple HTTP command against the remote server and the result is returned in JSON format.

        "remotes": [

So if we start a sync on the remote instance we should be able to view the progress on the UI dashboard.

rclone rc sync/sync srcFs=\ dstFs=EncGDrive:Backups _async=true --rc-user=test --rc-pass=secret

By sending the two parameters srcFs and dstFs to sync/sync we will get a sync job running. If we just do that we will have to wait for the job to finish in the CLI. When adding the parameter _async=true the command will immediately return with a JSON result containing the jobid. When we then navigate to the dashboard in the web UI we can see the sync running.

By scheduling the execution of this we can have backup jobs running daily, weekly or whatever interval we like and check on the progress from the web UI. Check the Rclone remote documentation for more information on what commands you can run remotely.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: