0

I'm trying to setup rclone to let me sync my remote Google Drive, and I've been able to configure everything successfully (once I downloaded a newer version of rclone; the Linux Mint version was out of date and didn't work).

By running:

rclone copy remote-google:/ /home/me/drive/

I'm able to download all the files from my drive. There's only one problem: I only get the files, not their folder/directory structure. Every file shows up on my computer in one giant folder.

At the command line I see no explanation for this, just a lot of duplicate warnings:

2025/04/04 10:42:58 NOTICE: Google Photos/2008/03/Picture 195-MIX.jpg: Duplicate object found in source - ignoring

Can anyone explain how I can download my drive through rclone ... with the directories intact?

machineghost
  • 1,296

2 Answers2

1

Is there a particular requirement to use rclone? If not, consider trying gdrive, written in Rust, based on a previous version written in Go. The initial config is a bit annoying because you need to create an "app" in Google Cloud, but it's not difficult. This is because no third party touches your files, so the app keys are all private to you, thus is more secure. You never have to fully publish it, because only you will use it. If you're on Google Workspace, then you use the Internal app type, which is slightly easier.

You download the last release, drop it in your PATH (e.g. ~/.local/bin/), then run:

gdrive account add

This walks you through the app setup process.

Once that's over, cd into your local destination directory, for ease and safety. You can see what it will access with this:

gdrive files list

To grab everything, and retain folder structure, you iterate only the list of top-level IDs, so you might do something like this:

gdrive files list --max=100 | tail -n +2 | cut -d ' ' -f 1 | while read -r id
do
    gdrive files download --recursive "$id"
done

It provides detailed help for all commands with gdrive help, or by prefixing help to the arguments, e.g.:

gdrive help files download

This is a one-way process, which defaults to not overwriting existing files. Like other tools, it cannot download Sheets, Docs, etc. type files. You'll see an error like:

Error: Failed to download file: Bad Request: {"error":{"code":403,"errors":[{"domain":"global","location":"alt","locationType":"parameter","message":"Only files with binary content can be downloaded. Use Export with Docs Editors files.","reason":"fileNotDownloadable"}],"message":"Only files with binary content can be downloaded. Use Export with Docs Editors files."}}

See gdrive help files export for offline copies of those.

Roy
  • 46
0

I finally figured out the problem: rclone was downloading my files in folders! However, it was also downloading my Google Docs files, which I wasn't expecting (since they don't appear as files in my online drive on Google).

Those files had similar names to documents I had (in folders) in my drive, and they download first (before any of my actual drive files), so it looked like I was just getting files without folders. However, after I let all of those (Google Docs) files download, I started getting all my Google Docs files ... with folders.

machineghost
  • 1,296