How to Sync File and Directories to Cloud Storage in Linux Using Rclone Tool?
Rclone is a command-line tool for synchronizing files and directories between Google Drive, Amazon S3, Openstack Swift / Rackspace cloud files / Memset Memstore, Dropbox, Google Cloud Storage, and the local filesystem. It is a single binary file that contains a Go program. Rclone is an MIT-licensed Free and Open Source Software that can be found in its Github repository.
First, you need to install curl using the below command, if you already have, you can skip this step:
$ sudo apt-get install curl
By running the following command, you can install Rclone using the installation script:
$ curl https://rclone.org/install.sh | sudo bash
Rclone now should be installed in your system.
The next step is to run the rclone config command to generate your config file. It will be used for rclone authentication in the future. Run the following command to start the configuration setup.
$ rclone config
We now have the option of creating a new remote. We’ll definitely want to add a remote because we don’t have one right now.
Give it a name; we’ve given it the name gdrive :
Following that, we’ll be given a list of sources to use with our new remote. Since we’re going to try Google Drive, we’ll pick 15
We are selecting 15 which is Google Drive.
Just press enter to leave default:
You may simply leave the default answer, which is an empty ” “, for the remaining questions.
When prompted, select “autoconfig,” which will generate all the necessary information to link to your Google Drive and grant rclone permission to use Google Drive data.
Now you need login into your Google account and give permission to allow it.
Now select yes:
Now we’ll learn how to transfer/sync files and directories with Google Drive using Rclone. Here are some examples of what we can do with the Rclone function.
Copy Data with rclone
We may use rclone copy source: to copy a file or folder rclone copy source: path dest: path order
rclone copy /home/ubuntu/Documents gdrive:test
List Remote Directory
rclone ls des:path
Sync data with rclone
Using the command we can easily synchronize the source with the destination. as rclone sync source: path dest: path
We’ve built Rclone and learned how to use it, which is great. As far as we know, this article explains what Rclone is, its functionality, and how to install and use it. Rclone is a command-line tool for synchronizing files and directories between Google Drive, Amazon S3, Openstack Swift / Rackspace cloud files / Memset Memstore, Dropbox, Google Cloud Storage, and the local filesystem.