POSTS

Using rclone for remote storage

The rclone program is a wonderful tool for working with remote storage.

Since it allows a wide variety of configuration options in a consistent interface, it can be better and more convenient when interacting with cloud storage providers such as Dropbox, pCloud, Google Drive, etc., than the software from the vendors themselves.

For example, in addition to copying or syncing from local to remote and vice versa, rclone also lets you do things like mount a remote drive and make it look like a local drive or encrypt everything you send to the remote.

Setup a remote connection

Use rclone to setup a remote connection to your cloud storage provider (e.g., see instructions for pCloud or Dropbox). For example, you can create a remote named something like pCloudFull to represent your full drive in the cloud as described in the rclone docs for pCloud.

You can then easily copy files from your local machine to the cloud remote via something like:

rclone copy /some/local/file.txt pCloudFull:path/to/remote/

Notice that you want to just specify the directory on the remote (i.e., /path/to/remote) not the destination file name (i.e., file.txt). This may be slightly non-intuitive, but rclone just works that way to make it easier to copy multiple files into a directory.

Similarly if you wanted to copy a file from your remote to your local machine, you would do something like:

rclone copy pCloudFull:path/to/remote/file.txt /some/local/path/

Setup an encryption layer

Using rclone crypt, you can setup a new remote named something like pCloudEncrypted which wraps your pCloudFull remote with encryption. Then when you send something into the cloud using the pCloudEncrypted via a command like

rclone copy /some/local/file.txt pCloudEncrypted:path/to/remote/

your file.txt will show up in the cloud as encrypted. This will prevent your cloud storage provider from accessing your data.

Note that you should probably use configuration encryption to protect the secret keys which rclone stores in your config file.

Setup a local mount

Finally, you can setup a local mount via a command like

rclone mount pCloudEncrypted /mnt/encrypted_cloud --vfs-cache-mode full

so that your machine will appear to have a directory called /mnt/encrypted_cloud which is actually connected (via encryption) to your cloud drive. The --vfs-cache-mode full option basically tells rclone to cache some of the cloud data locally so that /mnt/encrypted_cloud behaves very much like a directory that is on your machine. You can select other mount options for things like read-only or better performance.

Note that doing mounts on Windows will require you to download and install winfsp.