How to sync Google Drive storage on Ubuntu with Rclone

Recommended Ubuntu book

There is no official Google Drive sync for Linux at the moment and we needed samba drive to backup files to Google Drive. To accomplish the goal, we decided to use Rsync.

Following installation instructions (, we execute the following commands.


curl -O

Since its a new ubuntu installation, we need to install unzip package:

sudo apt install unzip

Unzip and navigate to new directory:

cd rclone-*-linux-amd64

Copy the binary file and change permissions:

sudo cp rclone /usr/bin/
sudo chown root:root /usr/bin/rclone
sudo chmod 755 /usr/bin/rclone

Install manpage

sudo mkdir -p /usr/local/share/man/man1
sudo cp rclone.1 /usr/local/share/man/man1/
sudo mandb

Configure rclone:

rclone config

Enter “n” for new remote since its a new remote and name it “remote” (following the guide at

“Google Drive” is under point 10, so we enter “10” and press Enter. It then asks for “client_id”, “client_secret” and “service_account_file”, which we leave empty and press Enter.

Then we enter “n” for auto config. It gives us a link to open which we open and get the auth code. Paste it in and continue. Press “n” for team drive, “y” to confirm configuration and press “q” to exit config.


Create a bash script:

cd ~
sudo mkdir cron
cd cron
sudo vi

Add this script (change folder name as needed and make sure it exists in Google Drive):

if pidof -o %PPID -x ""; then
exit 1
rclone sync /home/MyShareFolder/ remote:MyShareFolder/ -v -u --checkers 1 --transfers 1 --log-file=/home/user/cron/rclone-upload.log

Make it executable

sudo chmod a+x


sudo sh

Comments are closed.