Rclone as a helper for external backups
First Test
An initial test will show you if everything worked out so far. Select a small local text file and copy it to the cloud repository with:
rclone copy mytext.txt gdrv:mytext.txt
This may take a while, because Rclone works very slowly without options. My text only reached a transmission speed of 58bps without parameters. I learned this by specifying the parameter -P
(Figure 3). The "Accelerating Rclone" box explains parameters that you need to pass in to accelerate the Rclone commands.
Accelerating Rclone
You can specify the number of parallel file transfers via --transfers
. For example, to back up a folder with 50 files, specify --transfers=25
. As a rule, a value that is too high does not do any damage.
The --checkers
parameter defines the number of test processes running in parallel. The processes identify all the files to be uploaded and compare them with what is already in the cloud store. In this way, the system excludes unchanged data from the transfer. The value is based on the --transfers
parameter.
Using --drive--chunk-size
, you can specify how much memory Rclone uses when uploading. The developers recommend 16MB, which you specify as --drive--chunk-size=16384k
. However, experimenting with higher values will not do any harm. If you also specify the --progress
(-P
) parameters, you can see the exact values for the upload's duration. Rclone provides even more information with the -v
or -vv
options.
Step on the Gas
In order to investigate the effect of the acceleration options, I had Rclone back up a folder with 10 images with a size of 40MB in a folder to be created on the target (Listing 1). The average data rate during the backup fluctuated in the test at around 500KBps; doubling of the chunk size returned about 620KBps.
Listing 1
Testing Acceleration Options
Then I added three files with a size of 12MB to the locally stored image folder and restarted the backup with the same command. Since Rclone now only saved the newly added data, the process was completed in about 25 seconds. When restoring Google Drive to the local instance, no parameters are required. The command is otherwise the same as the copy
command; you only have to swap source and destination.
Copy and Sync
In addition to copying, Rclone also lets you synchronize files between a client and a server. The difference between copy
and sync
is that the latter compares the target with the source file by file and deletes everything on the target that is not in the source directory from which you issue the command.
If you call a sync
command from the wrong directory, you risk losing important data. The sync
option should therefore be tested with the --dry-run
parameter. copy
does not delete any data locally; however, the process overwrites the backup in the cloud. If you want to keep a backup, you can bypass this process by using the backup directory mentioned above.
Another way to connect to Rclone is to mount Google Drive as a filesystem in your home directory using Filesystem in Userspace (FUSE) [6]. In my example, I created the cloud/
folder there and then mounted the previously configured Google Drive account (Listing 2).
Listing 2
Mounting with FUSE
« Previous 1 2 3 4 Next »
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
TUXEDO Computers Unveils Linux Laptop Featuring AMD Ryzen CPU
This latest release is the first laptop to include the new CPU from Ryzen and Linux preinstalled.
-
XZ Gets the All-Clear
The back door xz vulnerability has been officially reverted for Fedora 40 and versions 38 and 39 were never affected.
-
Canonical Collaborates with Qualcomm on New Venture
This new joint effort is geared toward bringing Ubuntu and Ubuntu Core to Qualcomm-powered devices.
-
Kodi 21.0 Open-Source Entertainment Hub Released
After a year of development, the award-winning Kodi cross-platform, media center software is now available with many new additions and improvements.
-
Linux Usage Increases in Two Key Areas
If market share is your thing, you'll be happy to know that Linux is on the rise in two areas that, if they keep climbing, could have serious meaning for Linux's future.
-
Vulnerability Discovered in xz Libraries
An urgent alert for Fedora 40 has been posted and users should pay attention.
-
Canonical Bumps LTS Support to 12 years
If you're worried that your Ubuntu LTS release won't be supported long enough to last, Canonical has a surprise for you in the form of 12 years of security coverage.
-
Fedora 40 Beta Released Soon
With the official release of Fedora 40 coming in April, it's almost time to download the beta and see what's new.
-
New Pentesting Distribution to Compete with Kali Linux
SnoopGod is now available for your testing needs
-
Juno Computers Launches Another Linux Laptop
If you're looking for a powerhouse laptop that runs Ubuntu, the Juno Computers Neptune 17 v6 should be on your radar.