Skip to content
Related Articles

Related Articles

Improve Article
How to Sync File and Directories to Cloud Storage in Linux Using Rclone Tool?
  • Difficulty Level : Hard
  • Last Updated : 20 Apr, 2021

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.

Installation

First, you need to install curl using the below command, if you already have, you can skip this step:

$ sudo apt-get install curl
Rclone Sync File and Directories to Cloud Storage in Linux

Installing curl

By running the following command, you can install Rclone using the installation script:

$ curl https://rclone.org/install.sh | sudo bash
Rclone Sync File and Directories to Cloud Storage in Linux

Installing Rclone using the script

Rclone now should be installed in your system.

Configuring

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
Rclone Sync File and Directories to Cloud Storage in Linux

Run 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.

Select “n” for remote

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

Rclone Sync File and Directories to Cloud Storage in Linux

We are selecting 15 which is Google Drive.

Rclone Sync File and Directories to Cloud Storage in Linux

We are selecting 15 which is Google Drive

Just press enter to leave default:

Just press enter to leave the 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.

Select y

Now you need login into your Google account and give permission to allow it.

Rclone Sync File and Directories to Cloud Storage in Linux

Give permission to rclone

Now select yes:

Select y

Using Rclone

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
Rclone Sync File and Directories to Cloud Storage in Linux

Copy file

List Remote Directory

rclone ls des:path
Rclone Sync File and Directories to Cloud Storage in Linux

List files

Sync data with rclone

Using the command we can easily synchronize the source with the destination. as rclone sync source: path dest: path 

Sync data

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.

My Personal Notes arrow_drop_up
Recommended Articles
Page :