Copying the data in folder from Google Drive works properly when I use the name of the folder, yet not when I use the folder ID

What is the problem you are having with rclone?

This command works properly…

rclone copy "remote:/A folder of mine named foo on Google Drive" "/home/user_name/backed_up_from_Google_Drive"

In other words, when I run that command, the data in “A folder of mine named foo on Google Drive” is copied successfully to /home/user_name/backed_up_from_Google_Drive.

https://drive.google.com/drive/folders/1kG0sKNbPad4wgWKAGR is the URL associated with “A folder of mine named foo on Google Drive”

Yet, these commands fail…

rclone copy "remote:/1kG0sKNbPad4wgWKAGR" "/home/user_name/backed_up_from_Google_Drive"

and

rclone copy "remote:/1kG0sKNbPad4wgWKAGR/subfolder" "/home/user_name/backed_up_from_Google_Drive"

In other words, when I run either of those commands, the data in “A folder of mine named foo on Google Drive” fails to be copied to /home/user_name/backed_up_from_Google_Drive.

Run the command 'rclone version' and share the full output of the command.

rclone v1.65.0

  • os/version: linuxmint 21.2 (64 bit)
  • os/kernel: 5.15.0-89-generic (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.21.4
  • go/linking: static
  • go/tags: none
    Rclone downloads

Which cloud storage system are you using? (eg Google Drive)

Google Drive

The command you were trying to run (eg rclone copy /tmp remote:tmp)

I included that above.

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

[remote]
type = drive
scope = drive.readonly
token = XXX
team_drive = 
### Double check the config for sensitive info before posting publicly

A log from the command that you were trying to run with the -vv flag

~$ rclone copy ":/1kG0sKNbPad4wgWKAGR" "/home/user_name/data_I_backed_up_from_Google_Drive" -vv
2023/12/04 14:57:39 DEBUG : rclone: Version "v1.65.0" starting with parameters ["rclone" "copy" "remote:/1kG0sKNbPad4wgWKAGR" "/home/user_name/data_I_backed_up_from_Google_Drive" "-vv"]
2023/12/04 14:57:39 DEBUG : Creating backend with remote "remote:/1kG0sKNbPad4wgWKAGR"
2023/12/04 14:57:39 DEBUG : Using config file from "/home/user_name/.config/rclone/rclone.conf"
2023/12/04 14:57:39 DEBUG : Google drive root '1kG0sKNbPad4wgWKAGR': 'root_folder_id = 0AO7ZTNl-VFIMUk9PVA' - save this in the config to speed up startup
2023/12/04 14:57:40 DEBUG : fs cache: renaming cache item "remote:/1kG0sKNbPad4wgWKAGR" to be canonical "remote:1kG0sKNbPad4wgWKAGR"
2023/12/04 14:57:40 DEBUG : Creating backend with remote "/home/user_name/data_I_backed_up_from_Google_Drive"
2023/12/04 14:57:40 ERROR : Google drive root '1kG0sKNbPad4wgWKAGR': error reading source root directory: directory not found
2023/12/04 14:57:40 DEBUG : Local file system at /home/user_name/data_I_backed_up_from_Google_Drive: Waiting for checks to finish
2023/12/04 14:57:40 DEBUG : Local file system at /home/user_name/data_I_backed_up_from_Google_Drive: Waiting for transfers to finish
2023/12/04 14:57:40 ERROR : Attempt 1/3 failed with 1 errors and: directory not found
2023/12/04 14:57:40 ERROR : Google drive root '1kG0sKNbPad4wgWKAGR': error reading source root directory: directory not found
2023/12/04 14:57:40 DEBUG : Local file system at /home/user_name/data_I_backed_up_from_Google_Drive: Waiting for checks to finish
2023/12/04 14:57:40 DEBUG : Local file system at /home/user_name/data_I_backed_up_from_Google_Drive: Waiting for transfers to finish
2023/12/04 14:57:40 ERROR : Attempt 2/3 failed with 1 errors and: directory not found
2023/12/04 14:57:40 ERROR : Google drive root '1kG0sKNbPad4wgWKAGR': error reading source root directory: directory not found
2023/12/04 14:57:40 DEBUG : Local file system at /home/user_name/data_I_backed_up_from_Google_Drive: Waiting for checks to finish
2023/12/04 14:57:40 DEBUG : Local file system at /home/user_name/data_I_backed_up_from_Google_Drive/home/user_name/data_I_backed_up_from_Google_Drive: Waiting for transfers to finish
2023/12/04 14:57:40 ERROR : Attempt 3/3 failed with 1 errors and: directory not found
2023/12/04 14:57:40 INFO  : 
Transferred:   	          0 B / 0 B, -, 0 B/s, ETA -
Errors:                 1 (retrying may help)
Elapsed time:         1.1s

2023/12/04 14:57:40 DEBUG : 6 go routines active
2023/12/04 14:57:40 Failed to copy: directory not found

I might be wrong but what made you believe that you can use it like this?

remote:/1kG0sKNbPad4wgWKAGR

Looks for folder named 1kG0sKNbPad4wgWKAGR and it does not exist and rclone throws correct error:

2023/12/04 14:57:40 ERROR : Google drive root '1kG0sKNbPad4wgWKAGR': error reading source root directory: directory not found

What should work is copying from remote,root_folder_id=1kG0sKNbPad4wgWKAGR:

So something like

rclone copy "remote,root_folder_id=1kG0sKNbPad4wgWKAGR:" "/home/user_name/data_I_backed_up_from_Google_Drive" -vv

Thanks for taking the time to respond to me.

That failed.

~$ rclone copy ",root_folder_id=1kG0sKNbPad4wgWKAGR:" "/home/user_name/data_I_backed_up_from_Google_Drive" -vv
2023/12/05 05:34:00 DEBUG : rclone: Version "v1.65.0" starting with parameters ["rclone" "copy" "remote,root_folder_id=1kG0sKNbPad4wgWKAGR:" "/home/user_name/data_I_backed_up_from_Google_Drive" "-vv"]
2023/12/05 05:34:00 DEBUG : Creating backend with remote "remote,root_folder_id=1kG0sKNbPad4wgWKAGR:"
2023/12/05 05:34:00 DEBUG : Using config file from "/home/user_name/.config/rclone/rclone.conf"
2023/12/05 05:34:00 DEBUG : remote: detected overridden config - adding "{_DEWV}" suffix to name
2023/12/05 05:34:00 DEBUG : fs cache: renaming cache item "remote,root_folder_id=1kG0sKNbPad4wgWKAGR:" to be canonical "remote{_DEWV}:"
2023/12/05 05:34:00 DEBUG : Creating backend with remote "/home/user_name/data_I_backed_up_from_Google_Drive"
2023/12/05 05:34:00 DEBUG : Local file system at /home/user_name/data_I_backed_up_from_Google_Drive: Waiting for checks to finish
2023/12/05 05:34:00 DEBUG : Local file system at /home/user_name/data_I_backed_up_from_Google_Drive: Waiting for transfers to finish
2023/12/05 05:34:00 INFO  : There was nothing to transfer
2023/12/05 05:34:00 INFO  : 
Transferred:   	          0 B / 0 B, -, 0 B/s, ETA -
Elapsed time:         0.3s

2023/12/05 05:34:00 DEBUG : 6 go routines active

I was guessing.

Perhaps I am wrong, but apparently Rclone does not support using folder IDs to identify file/filders in Google Drive.

The copy worked. Apparently there was nothing in that folder though.

You are correct; I was wrong.

I just changed the folder ID and ran the command you provided to me to successfully backup data from a folder of mine on Google Drive which actually has some files in it, to my local SSD.

Thank you very much for taking the time to help me out. I appreciate it very much.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.