There's a simple rule for file backups, the so-called 3-2-1 rule: 3 copies, 2 different media, 1 offsite. Applying this simple rule ensures that in the case of a calamity there is a high chance you are able to recover your files. However, creating automated offsite backups is not a trivial task. Luckily, rclone comes to the rescue.
Rclone is command-line tool similar to
rsyncwith cloud storage support. This means that you can copy your files to cloud providers such as Dropbox, OneDrive, Google Drive and many more with one single command, with the same ease of use as
rsync. The full list of supported providers is available here and I think chances are high your cloud provider of choice will be supported.
The instructions to install
rclone are located on the rclone website: https://rclone.org/install/. You can even find an option to run
rclone using Docker without installing it.
rcloneis well documented at https://rclone.org/docs/. However, below you can find the steps to quickly get started:
- Configure a remote cloud storage using
rclone config. The configuration is stored in
rclone sync <source_path> <remote_name>:<remote_path>to sync a directory with a remote cloud storage directory. Syncing ensures only differences are copied, saving bandwidth.
rclone copy <source_path> <remote_name>:<remote_path>to fully copy the directory.
There are various other ways you can use
rclone, and there are a lot of arguments available for use that you can use to optimize the command you want to use. Be sure to seek out the
Create a cronjob
Finally, add your
rclone command to the crontab to ensure your files are synced or copied to your cloud storage provider on a recurring basis.
That's it, ensuring your files are backed up automatically to a cloud storage provider can't be any easier than