Using Google Drive on Debian/Ubuntu with Rclone

Rclone is an open-source command-line tool that enables you to synchronize a local Linux directory with various cloud storage services. With Rclone to schedule automated backups of your MySQL/MariaDB server to Google Drive, Dropbox, and many other cloud storage providers. In this blog post, we look at how to install and setup Rclone. We also cover how you can schedule automated backups of your MySQL/MariaDB server to your cloud provider such as Google Drive.

Install Rclone on Debian/Ubuntu

as usual, update & upgrade server

sudo apt update && sudo apt upgrade

sudo apt install rclone -y

Adding new remote

Once you have installed rclone successfully, you need to configure rclone. Enter the following command in the terminal:

rclone config

If it’s your first time using rclone, you have to add a new remote to rclone. Select ‘n‘ to add a new remote.

Now you have to enter the name of the remote. You can enter any name here that matches the cloud service so that it is easy to identify. I am using ‘Gdrive‘.

Select cloud service you want to sync with rclone

After entering the name and hitting enter, you will see a list of cloud services like Google cloud storage, Box, One Drive, and others.

You have to enter the number of the service you want to use. In this case, it’s ‘Drive’. Make sure you enter the correct number.

As you don’t need to enter client ID or secret ID hit Enter twice.

Choose the permission type and number

It will ask root folder ID and Credentials JSON file path just hit enter twice

Next enter ‘N’ for selecting no for advanced configuration. Of course, if you want to configure something very specific, you can go ahead with Y.

When you’re asked for ‘Use auto config’, press Y.

Login to Google Drive account

When you enter ‘y’ and hit enter, you will get a link, open it in a browser and here you have to log into your Google account. And if it asks for permission click on ‘yes’. and copy the code and paste it on the terminal.

If you want to configure this as a team drive you can hit enter Y and proceed or just hit N. next confirmation will be asked hit Y and quite from rclone typing Q

To sync a file 
rclone sync source:path dest:path
rclone sync /home/mahesh/mahesh.txt Gdrive:UPLOADS

0 Komentar