rclone is a fantastic software that lets you manage your data in the cloud. Currently, it supports a wide range of clouds.

Installing

To download and install, you can refer to rclone downloads. For macOS/Linux -

curl https://rclone.org/install.sh | sudo bash

For Windows

choco install rclone

Configuration

rclone config file will give the location of the rclone configuration file. Mostly this would be in your home directory - ~/.config/rclone/rclone.conf. It’s recommended to set a password for your configuration to be encrypted and protected. Set configuration password - rclone config, which will give you the list below.

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q>

Select s to set the configuration password. After setting whenever you want to view your remotes rclone listremotes then you will be asked for a password. You can use either pass or gpg to store this password (refer Choosing a password manager to know more about this.) and you can set environment variable RCLONE_PASSWORD_COMMAND to pass rclone_pass or gpg -dq ~/.password-store/rclone_pass.gpg For example for MacOS/Linux, you can set this in your bashrc or zshrc file.

export RCLONE_PASSWORD_COMMAND="pass rclone_pass"
OR 
export RCLONE_PASSWORD_COMMAND="gpg -dq ~/.password-store/rclone_pass.gpg"

For Windows, In powershell profile (notepad $PROFILE), you can have below settings. Replace path with your pass gpg file path.

rclone completion powershell | Out-String | Invoke-Expression
$env:RCLONE_PASSWORD_COMMAND = 'gpg -dq C:\Users\username\.passwordstore\rclone_pass.gpg'
set-location c:\users\username

Adding a remote

Adding a remote is simple; you can run rclone config and select n for a new remote and select the cloud you want to add from the menu. You can input the option number or option string drive and follow the next steps. rclone has extensive documentation for each cloud provider for example Google Drive and Microsoft OneDrive. You can also add your cloud, for example, nextcloud (refer Setup your cloud using nextcloud) like below. After logging in to your nextcloud server, click on settings and copy the Webdav URL in the left corner.

Nextcloud Webdav URL

Follow steps here to add storage using Webdav URL. When you copy, you might get something like this https://www.example.com/nextcloud/remote.php/dav/files/username/ At this step, give a URL like below (note that URL has /nextcloud and should end with webdav, not dav)

Choose a number from below, or type in your own value
 1 / Connect to example.com
   \ "https://example.com"
url> https://example.com/nextcloud/remote.php/webdav/

Encrypting your data in the cloud

If you want to store your data in encrypted format in cloud storage, then you do rclone config and select n and select the crypt option, and select the remote where you want the files stored in an encrypted format. Follow this guide for more detailed steps. Now, if you copy any files using rclone to this crypt location, rclone -q copy plaintext secret: if you go to the actual location in remote, you will see encrypted files. The only way to view them is to use rclone again.

Manage your data

You can use rclone help to all the available options. Below are some commands that can help you manage your data using rclone.

Action Command
View all remotes rclone listremotes
View all folders at root folder of cloud rclone lsd drive:
View all files recursively at root folder rclone ls drive:
View all files recursively at selected folder rclone ls drive:path/to/folder
View size a drive rclone size drive:
View the contents of the file rclone cat onedrive:Documents/Notes.txt
Copy files from local to remote rclone copy ~/Documents drive:Documents
Copy files from remote to remote rclone copy onedrive:Documents drive:Documents
Sync files from local to remote rclone -P sync ~/Documents drive:Documents
Sync files from remote to remote rclone -P sync onedrive:Documents drive:Documents
Delete a folder rclone purge onedrive:Documents
Delete a file rclone deletefile onedrive:Documents/file.txt
Mount a drive rclone mount --daemon drive: ~/drive OR rclone mount remote:path/to/files X:

Mobile Apps

You can install rclone using pkg install rclone in Termux. Please note that you won’t be able to mount remotes. If you prefer a UI app, refer to Rclone for Android. The app can load your rclone configuration. You can manage all your remotes there. You can access your encrypted data in other apps using the RCX app. You need to enable option - Enable Content Provider Preview.

Select Enable Content Provider Preview

Conclusion

Above is how you can manage your data in the cloud using rclone. I hope this helps. – RC