Sync Google Drive to RasPi NAS Mount Point

What is the problem you are having with rclone?

I am trying to use the "rclone sync" command to sync the contents from my google drive to a NAS. The contents of the Google Drive exist in the "Computers" section of Google Drive (since they are being originally sourced from laptop), but this is so that files from my Google Drive can be downloaded to the NAS even while I am not home. How do I call upon directory?

lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda           8:0    0 238.5G  0 disk
└─sda1        8:1    0 238.5G  0 part /media/pi/Branch1
mmcblk0     179:0    0 119.4G  0 disk
├─mmcblk0p1 179:1    0   512M  0 part /boot/firmware
└─mmcblk0p2 179:2    0 118.9G  0 part /

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

rclone v1.68.2
- os/version: raspbian 12.8 (64 bit)
- os/kernel: 6.6.62+rpt-rpi-2712 (aarch64)
- os/type: linux
- os/arch: arm64 (ARMv8 compatible)
- go/version: go1.23.3
- go/linking: static
- go/tags: none

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)

rclone sync gdrive:Documents /dev/sda1

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

[gdrive]
type = drive
scope = drive.readonly
team_drive =
token = XXX
### 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

2024/12/09 05:40:27 DEBUG : rclone: Version "v1.68.2" starting with parameters ["rclone" "sync" "gdrive:Documents" "/dev/sda1" "-vv"]
2024/12/09 05:40:27 DEBUG : Creating backend with remote "gdrive:Documents"
2024/12/09 05:40:27 DEBUG : Using config file from "/home/erikg/.config/rclone/rclone.conf"
2024/12/09 05:40:27 DEBUG : Google drive root 'Documents': 'root_folder_id = 0ACVvxQv59wrwUk9PVA' - save this in the config to speed up startup
2024/12/09 05:40:27 DEBUG : Creating backend with remote "/dev/sda1"
2024/12/09 05:40:27 ERROR : : failed to open directory "": open /dev/sda1: permission denied
2024/12/09 05:40:27 ERROR : Google drive root 'Documents': error reading source root directory: directory not found
2024/12/09 05:40:27 DEBUG : Local file system at /dev/sda1: Waiting for checks to finish
2024/12/09 05:40:27 DEBUG : Local file system at /dev/sda1: Waiting for transfers to finish
2024/12/09 05:40:27 ERROR : Local file system at /dev/sda1: not deleting files as there were IO errors
2024/12/09 05:40:27 ERROR : Local file system at /dev/sda1: not deleting directories as there were IO errors
2024/12/09 05:40:27 ERROR : Attempt 1/3 failed with 2 errors and: directory not found
2024/12/09 05:40:27 ERROR : : failed to open directory "": open /dev/sda1: permission denied
2024/12/09 05:40:27 ERROR : Google drive root 'Documents': error reading source root directory: directory not found
2024/12/09 05:40:27 DEBUG : Local file system at /dev/sda1: Waiting for checks to finish
2024/12/09 05:40:27 DEBUG : Local file system at /dev/sda1: Waiting for transfers to finish
2024/12/09 05:40:27 ERROR : Local file system at /dev/sda1: not deleting files as there were IO errors
2024/12/09 05:40:27 ERROR : Local file system at /dev/sda1: not deleting directories as there were IO errors
2024/12/09 05:40:27 ERROR : Attempt 2/3 failed with 2 errors and: directory not found
2024/12/09 05:40:27 ERROR : : failed to open directory "": open /dev/sda1: permission denied
2024/12/09 05:40:27 ERROR : Google drive root 'Documents': error reading source root directory: directory not found
2024/12/09 05:40:27 DEBUG : Local file system at /dev/sda1: Waiting for checks to finish
2024/12/09 05:40:27 DEBUG : Local file system at /dev/sda1: Waiting for transfers to finish
2024/12/09 05:40:27 ERROR : Local file system at /dev/sda1: not deleting files as there were IO errors
2024/12/09 05:40:27 ERROR : Local file system at /dev/sda1: not deleting directories as there were IO errors
2024/12/09 05:40:27 ERROR : Attempt 3/3 failed with 2 errors and: directory not found
2024/12/09 05:40:27 INFO  :
Transferred:              0 B / 0 B, -, 0 B/s, ETA -
Errors:                 2 (retrying may help)
Elapsed time:         0.7s

2024/12/09 05:40:27 DEBUG : 6 go routines active
2024/12/09 05:40:27 NOTICE: Failed to sync with 2 errors: last error was: directory not found

You do not have such directory…. This is device, not folder.

Use some existing directory.

For example

This resolved the destination error, but this doesn't resolve the source error. How do I reach folders from within the synced computers directory of Google Drive?

can you run:

rclone lsd gdrive:

Returns no result
image

So obviously gdrive:Documents does not exist:) and you can't sync anything from it.

It suggests that either your google drive is empty or misconfigured.

rclone lsd does not produce any error so it works and connects to your gdrive. But there are no directories there.

Yes, because that is pulling from the main Google Drive directory. But as written in my original question, I am trying to pull from the synced computers directory from my Google Drive...

well...

you are not obviously. You tell rclone explicitly to use your Google Drive.

If this is what you want then use this directory as your source. Something like:

rclone sync /path/to/source/directory /path/to/destination/directory

Obviously, what you are suggesting still doesn't resolve what I am trying to achieve. If rclone simply can't call upon files from within the synced computers section of Google Drive, it would be best to let me know that from the beginning.

If you are not familiar with how Google Drive works, it has 2 sections for storing files:

  1. in the main Google Drive, these files exist purely online.
  2. in the computers section. These files are synced between google drive and a Windows machine.

I am trying to create an auto sync from this computers section of google drive into my NAS so that changes I make while I am away from home on my laptop can be uploaded onto my NAS for backup purposes.

Create a shortcut to the computers folder in your gdrive.

Then you will be able to see it (rclone lsd) and use (rclone sync).

welcome to the forum,

to access data within the "Computers" tab on the drive web interface (where files from Google's Backup and Sync desktop program go).

1 Like

Thank you, this helped me and now they are now showing and properly syncing.

rclone lsd gdrive:
           0 2024-12-08 08:20:03        -1 Desktop
           0 2024-12-08 08:20:01        -1 Documents

While it is not stated in the document specifically, I found that you can not use:

rclone sync gdrive:Documents/ /path/to/destination/

But instead you have to specifically use:

rclone sync gdrive:/Documents/ /path/to/destination/

While a small change, that beginning forward slash got them to run. I checked on my phone and all the files are appearing without any errors.

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