Installing rclone Google Drive Backup | Raspberry Pi

Installing rclone Google Drive Backup | Raspberry Pi

Installing rclone Google Drive

How to install your Google Drive folders as well as various other clouds on your Raspberry Pi with Rclone

How to mount your Google Drive folders and other clouds on your Raspberry Pi with Rclone

Installing rclone Google Drive Among the issues that we all have when we use the Raspberry Pi is the absence of space. We utilize 32GB or 64GB microSD cards usually. If we want to use it to have many points we require more storage. We can fix this with a USB hard drive, yet there are times when we prefer to use a cloud. And also for these situations, what much better than using rclone to place what you make use of to conserve the files in the cloud as if it were one even more folder of your Raspberry Pi.

To begin, we have to know that depending on the link we have, this experience will certainly be far better or even worse. Usually, if we desire to make use of this possibility, we should have a fiber optic or HFC link with a good upload. Otherwise, we can access our data, however, when modifying we will certainly need to wait a long time, particularly if we are working with multi-megabyte data.

And also since we recognize the restrictions of collaborating with a cloud, we are going to use rclone to link to the cloud that we are using today as well as to place it as if it were simply an additional unit. We will achieve this by additionally utilizing a program called FUSE, which will be in fee of taking care of the setting up of the unit once we connect with rclone to it. And also now that we recognize what we are going to require, in addition to our cloud account, we are going to see just how to do all that as well as start collaborating with our cloud as if it were just one more storage space system of our Raspberry Pi.

Installing rclone and the necessary things.

The first point we have to do is make sure we have whatever upgraded and also mounted. You can take a look at this article that I made to see in even more depth how to update Raspbian if you want. Anyway, to have whatever as much as date, we can make use of the complying with command in the terminal

sudo apt update && sudo apt upgrade -y Since we have every little thing updated, we have to make certain that rclone will certainly work properly on our Raspberry Pi. To do this, we are going to set up FUSE. That we will do it with the adhering to command in the terminal.
sudo apt install fuse
Installing fuse on Raspbian

To ensure that we will certainly not have access troubles to the documents depending on the user that we are making use of in Raspbian, we need to change an option of FUSE. We do this by opening up the arrangement documents with the following terminal command.

sudo nano /etc/fuse.conf

Below we have to get rid of the hash (#) from the line that says user_allow_other. To ensure that it stays as the image we have below.

Modifying FUSE settings

To leave nano as well as conserve the documents, press Ctrl + X as well as depending upon whether we have Raspbian in English or Spanish, we will need to press the Y key or the S secret. We push the Enter crucial and also we will return to the terminal, with the changed file.

Currently, that we have every little thing ready, we will certainly continue with the setup of rclone. We can use the variation of the Raspbian repositories, however I suggest using the most recent official variation better, considering that if there is any kind of update in the cloud that we desire to utilize given that the version that we have offered in Raspbian came out, we will not have the ability to utilize it. For this we will utilize the following command from the terminal.

curl https://rclone.org/install.sh | sudo bash
Terminal after installing rclone

If every little thing is correct, something like what is in the picture above should appear in your terminal. Because situation, we already have rclone ready to utilize Google Drive or the cloud that we want of all that you have to pick from.

Setting up rclone to use Google Drive

Since we have everything ready, we have to set up rclone to attach to our cloud, in this situation, a Google Drive cloud. To do this we initially need to run the rclone configuration wizard, which we will do by placing the following in the terminal.

rclone config
Rclone setup wizard

We will certainly do this by pushing the N secret on our key-board. We push Get in, and we will certainly go to the following action, where we will certainly have to call the arrangement we are developing. Pushing Enter, we will go to the following component of the arrangement.

First step of rclone configuration

Google Drive, OneDrive, Dropbox, Google Photos as well as Mega are just a couple of examples of everything we can mount as a disk drive with this program. To choose what type of cloud we are going to utilize we have to put the number a sign of the kind of system that puts rclone, which in the situation of Google Drive at the time of doing this tutorial is 13.

List of rclone compatible systems

Obtaining Google credentials for rclone

It is possible that this sounds a few Chinese to you, but in recap, what rclone requires to connect to Google Drive are some qualifications to link to the API, which is in the cost of sending out the documents as well as receiving them when they are sent. We sent. To produce safety and security and also an id key we must log in with our Google account at console.developers.google.com as well as from there produce every little thing essential.

As soon as we are visited, if we have actually never logged in, it will ask us to accept the Google Cloud Platform regards to usage. For this, we checked out these conditions as well as inspect packages where they are approved and click proceed as well as accept.

Confirming the creation of Google Developers account

Now what we have to do is develop a task where we can produce the OAuth secrets to integrate our Google Drive with rclone. For the task, we can put what we desire, as long as it is something that identifies that job, in case we intend to transform points in the configuration later on. To finish, click produce as well as we will have the job prepared.

Creating the project for Rclone

We also have to set up the approval display of our application. We click on that button and also we will certainly see the adhering to the image, where the wizard for setting up the OAuth consent display starts.

Activating OAuth consent for Rclone

Now a type will appear with a lot of areas to submit. The just one that is obligatory is the Name of the application, where we will place the name we want. Now we go to the base of the type and also click Save to save the permission screen and we can produce our OAuth customer ID.

Confirmation of the creation of the consent screen for Rclone

To develop this customer ID for rclone we will Produce credentials, and also in the menu that appears we choose OAuth client ID. If whatever is appropriate, we will see one like this with our customer ID and also our secret key..

OAuth ID for Rclone

The customer ID must be gone into where it places client_id in the terminal where we are with the rclone arrangement wizard. And where it puts client_secret_id we need to put our secret key. The terminal must appear like this once we have gotten in that data.

Entering the OAuth ID in Rclone

Currently, we need to tell rclone exactly how to act when accessing Google Drive data. Depending upon the number we put, this is just how it will act. My guidance is to use number 1 to have complete accessibility to Google Drive, besides the application folders.

Rclone behavior when working with Google Drive

When we have selected the habits of rclone, we hesitate to tell it which will be the origin folder that we are going to use. In the root_folder_id component, we can place the ID of the folder that we are most likely to use. To know this ID we can access the folder from the internet browser as well as in the LINK of the very same we will certainly see a directory recognition with a great deal of letters and also numbers after folders/. Those numbers and letters are what we need to put in root_folder_id to make sure that when rclone places our Google Drive, it does so utilizing that folder. If we desire it to do it from the origin folder of Google Drive, we can leave that criterion vacant.

ID of the folder that we want to use as root in Rclone

It will ask us if we wish to edit the innovative setups. As for our regular procedure, we will not need several things; we claim no.

It will additionally ask us for a solution account in the service_account_id criterion. We will leave it blank, given that it is not essential.

Depending on whether we are doing this arrangement from a Raspberry Pi with a desktop computer or not, we have to suggest if we desire to do the automatic configuration or not. If you are in the Raspbian desktop setting, we will say yes.

Setting the Rclone access key to Google Drive

Below we will see what are the action in the instance of making use of a desktop atmosphere, where we can open a browser from the Raspberry Pi.
Setting up rclone with a desktop computer setting.

A browser home window will open up that will ask us to log in to our Google account when we placed Y. When we have done that we have a window such as this showing that the application has not been confirmed, which is regular, given that we created it 5 minutes ago.

Clicking Advanced setups, we will see a link that states Go to Rclone (not risk-free). It will place something else instead of rclone if you have named your application differently.

Unverified application message for Rclone

Now we will certainly see a window in which rclone is asking us for authorization to access our Google Drive account. Click Enable and afterward in the next home window that shows up, click on Permit once more. If whatever worked out, a home window like the complying with will certainly appear.

Success message when linking Rclone with Google Drive

Setting up rclone from terminal or SSH

For not having access to a desktop computer, we can configure the like the configuration coincides as that of the desktop computer setting, only that instead of the Google Drive API key instantly placed in the setup, we have to place us.

To begin this arrangement, we need to write N in the terminal. Next off, a LINK will show up that we need to enter a web browser order to get the Google Drive API key. As we see in the following screenshot.

Rclone indicating the address where we have to go to get the Google Drive API key

The only difference regarding the procedure with a graphical environment is that, as opposed to immediately configuring the password, it will appear in the internet browser and also then we will need to enter it in the incurable. You can see what I’m speaking about, here is a screenshot of what you should copy in the browser.

Google Drive API key for rclone

We create the code in the incurable where we are configuring rclone, and we can now terminal with the setup and also place our Google Drive on our Raspberry Pi.

Finishing the configuration of rclone

To finish, rclone will ask us if we are going to utilize this account as Group Drive. We claim no, and also we will see a recap with the settings we have actually produced, we indicate that everything is appropriate with Y, and also we will have rclone to utilize our Google Drive cloud. But there is still one thing missing.

Final screen of Rclone configuration

Although we’re made with the rclone arrangement, we still have to allow the Google Drive API in our Google developer account for rclone to work appropriately. We do this in the following method.

We have to go to the Libraries section by clicking on the section. This link gets on the right side of the web page. Now, in the internet search engine, we compose drive and click where it claims Google Drive API.

Enabling the Google Drive API for Rclone

Here a page will pack that will ask us if we desire to enable the Google Drive API. Click on Enable and a page must show up showing the demand data to the Google Drive API.

Google Drive API ready to receive rclone requests

Riding our Google Drive cloud on our Raspberry Pi

Since we have everything prepared, we can only install our cloud with rclone. For this, we are mosting likely to utilize the following commands in the terminal.

mkdir gdrive rclone mount --allow-other gdrive: gdrive
Commands to use Rclone in a folder we have created

To learn what all the commands do to adjust them to our needs, I am going to describe what each word we have actually written in the terminal does, in case it stops working or we have to alter something depending upon our configuration.

mkdir gdrive Produce a folder called gdrive where we are. When we have not moved via the folders in the terminal we will remain in the/ home/ pi folder, so the course of the folder that we have developed will certainly be/ house/ pi/ gdrive
rclone mount --allow-other gdrive: gdrive Rclone is the program that we are most likely to use. Mount is the command that tells rclone to place the unit that we suggest.-- Allow-other makes all individuals of the os accessible to that drive. Gdrive: refers to the arrangement that we will utilize. If at the time of developing the configuration, we have called it in another way, we must present another thing. And gdrive describes the path where the folder where we wish to place our Google Drive is. If every little thing worked out we can access without issues. As in the image I leave below. The only downside we can have is that we can close Google Docs documents.
Rclone running on Google Drive

How to use rclone as a service

The initial thing we have to do is develop a file with the service arrangement. We will do this with the adhering to command. As the drone folder we will create this data is not created by default, we have to develop it prior to.

Among things we will utilize this for is to constantly have our cloud easily accessible whenever we begin our Raspberry Pi. To do this, we are most likely to produce a service that begins each time we begin the Raspberry Pi.

mkdir -p ~/.config/systemd/user nano ~/.config/systemd/user/[email protected] As soon as we have nano open up to be able to contact those documents, we will duplicate the complying with to the data to produce the solution.
[Unit] Description=rclone: Remote FUSE filesystem for cloud storage config %i Documentation=man:rclone(1) [Service] Type=notify ExecStartPre=/bin/mkdir -p %h/mnt/%i ExecStart= \ /usr/bin/rclone mount \ --config="%h/.config/rclone/rclone.conf" \ --allow-other \ --drive-acknowledge-abuse=true \ --fast-list \ --vfs-cache-mode writes \ --vfs-cache-max-size 100M \ --umask 0777 \ %i: %h/mnt/%i ExecStop=/bin/fusermount -u -z %h/mnt/%i ExecStop=/bin/rmdir %h/mnt/%i Restart=on-failure [Install] WantedBy=default.target In this case, a couple more parameters have been added to rclone for a better operation. It has also been defined that a folder is created within the user directory called mnt and within this folder one with the name of the cloud that we are going to mount. In this way, if we have several clouds, we can add the rclone service several times to mount them all. Also, if the service fails it will automatically restart so that we can continue using it.
Creating the rclone @ .service file

Currently, that we have everything written, it just continues to be to exit nano with Ctrl + X and also conserve the documents prior to exiting with Y or S depending on the language with which we have Raspbian set up.

Once we have done that, we need to allow the solution to begin each time we activate the Raspberry Pi. We will do this with the complying with command in the terminal.

systemctl --user enable [email protected] Where rclone @ gdrive is composed we will need to alter gdrive by the name of the arrangement that we have placed in rclone. We must make use of that command once for each configuration that we have actually produced if we have even more than one setup.
Link created to start our cloud with rclone
A message will appear to us claiming that a web link has been created for our data if every little thing went well. All that continues to be is to reboot the Raspberry Pi and start using our cloud with rclone and delight in added and integrated storage space.

Share this post