rclone — Google drive on low-end Linux or without a GUI

So I have an old laptop running SliTaZ Linux. Now, with just 380 MB RAM and a 3-series kernel, I cannot run any of the browsers that would let me get at my google drive.

Enter rclone

rclone.org

first, went to rclone.org and downloaded the zipped binary for i386, unzipped the cotents in my ~/installs folder that I use for userspace stuff.

The cd into there and for now just run it using ./rclone

The default is to put a cache in ~/.cache/rclone and the config in ~/.config/rclone, so we can keep an eye on these.

Frst, configure it manually. By the way, the help on the website is very good.

My comments are ## enclosed like this ## My input is in bold, with <Enter> for hitting the Enter key on an empty line (obviously, I also hit Enter after actually typing something).

username@e500:~/installs/rclone-v1.58.1-linux-386$ ./rclone config No remotes found, make a new one?
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n
## You'll use this name to indentify the drive when typing commands, so I suggest something short and all lower case. ##
name> google
Option Storage.
Type of storage to configure.
Choose a number from below, or type in your own value.
1 / 1Fichier
\ (fichier)
2 / Akamai NetStorage

[snip]

16 / Google Cloud Storage (this is not Google Drive)
\ (google cloud storage)
17 / Google Drive
\ (drive)
18 / Google Photos
\ (google photos)

[snip]

19 / H
46 / seafile
\ (seafile)
## the bracketed names are the identifiers, you can see that Google drive is named 'drive', so typed drive here ##
Storage> drive
Option client_id.
Google Application Client Id
Setting your own is recommended.
See https://rclone.org/drive/#making-your-own-client-id for how to create your own.
If you leave this blank, it will use an internal key which is low performance. Enter a value. Press Enter to leave empty.
client_id> <Enter>
Option client_secret.
OAuth Client Secret.
Leave blank normally.
Enter a value. Press Enter to leave empty.
client_secret> <Enter>
Option scope.
Scope that rclone should use when requesting access from drive. Choose a number from below, or type in your own value.
Press Enter to leave empty.
1 / Full access all files, excluding Application Data Folder. \ (drive)
2 / Read-only access to file metadata and file contents.
\ (drive.readonly)
/ Access to files created by rclone only.
3 | These are visible in the drive website.
| File authorization is revoked when the user deauthorizes the app. \ (drive.file)
/ Allows read and write access to the Application Data folder. 4 | This is not visible in the drive website.
\ (drive.appfolder)
/ Allows read-only access to file metadata but
5 | does not allow any access to read or download file content. \ (drive.metadata.readonly)
scope> 1
Option root_folder_id.
ID of the root folder.
Leave blank normally.
Fill in to access "Computers" folders (see docs), or for rclone to use a non root folder as its starting point.
Enter a value. Press Enter to leave empty.
root_folder_id> <Enter>
Option service_account_file.
Service Account Credentials JSON file path.
Leave blank normally.
Needed only if you want use SA instead of interactive login. Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`.
Enter a value. Press Enter to leave empty.
service_account_file> <Enter>
Edit advanced config?
y) Yes
n) No (default)
y/n> <Enter>
Use auto config?
* Say Y if not sure
* Say N if you are working on a remote or headless machine
y) Yes (default)
n) No
y/n> <Enter>
## Slitaz on a small computer uses Midori as its browser; Midori, in my experience, cannot load Google drive, but it can handle some of the Google online interface (eg Gmail drops down to the basic HTML version, but works); I had to paste the given link into Midori, in which I was already logged in to Gmail, and it worked to allow me to approve the connection to rclone. ##
2022/06/18 10:24:41 NOTICE: If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=[object 2] 2022/06/18 10:24:41 NOTICE: Log in and authorize rclone for access 2022/06/18 10:24:41 NOTICE: Waiting for code...
## Once you visit the link above and click approve for rclone, the configurator gets the OK and stops waiting and you get the prompt to do the remaining steps. ##
2022/06/18 10:25:27 NOTICE: Got code
Configure this as a Shared Drive (Team Drive)?
y) Yes
n) No (default)
y/n> <Enter>

And done. Now, for example, you can list directories in your cloud drive by typing (once rclone is in the path — it’s a single binary, so you can just copy it or link it to ~/bin):

$ rclone lsd google:

It’s a bit like using scp. If youwant to copy a file, you can copy from the Google drive:

$ rclone copy localfile.ext google:folder1/folder2/

And get a file the same way:

$ rclone copy google:folder1/folder2/filename.ext .

And of course it can do many more compledx things, like rsunc type stuff to only copy changed files, or you can create a local mirror of your Google drive, and so on.

I imagine there would be a way to approve rclone from another computer, such that you could then use Google drive on a machine without X-windows, but I have not tried that. Anyway, it seems like a very simple yet powerful tool. It can, it says, be used for many cloud services. As well as SFTP, HTTP and other protocols, it can be used with DropBox, OneDrive and about 40 other services.

Author: Darren

I'm a scientist by training, currently working as a writer, trainer and editor.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.