Google drive sync/mount? And Syncthing...

Hi,

what is the best way to sync a folder at my raspberry with google drive?

Within my home network syncthing should sync my google drive between my PC/Notebook and my raspberry.

Kind regards.

Let me guess, its impossible to sync a google account on a DietPi system?

No, there are many methods. You could use https://github.com/vitalif/grive2, or rclone like https://medium.com/@artur.klauser/mounting-google-drive-on-raspberry-pi-f5002c7095c2.

I have installed rclone. In addition I had to install the package: apt-get install fuse. Furthermore I had to add an test user (my email Adresse) at the Goolge Cloud Plattform/OAuth consent screen so that rclone could be certified by google and get access.

Two things I couldn’t manage to run:

  • The autostart with systemd. I got stuck at the point where to create a link. I even didn’t find the the folder: $HOME/.config/systemd/user which is needed as the tutoriol says. So I tried the folder “/etc/systemd/system”. This folder I already know as a noob and would prefer therefor. But did not succeed. systemctl --user enable rclone@gdrive is giving the error: Failed to connect to bus: No such file or directory. Nonetheless the idea behind the tutorial to work with systemd templates is a very good one which I would like to get running. Has anybody an idea how to solve this?


  • Therefor I started rclone manually to give it a test. Everything mounts perfect. I can list all files and so on. But I gave syncthing a try. I didn’t work out, because of some permission issue. Is it even possible with Syncthing? What to do about the permissions?

2021-03-27 16:48:10: Loading ignores: lstat /mnt/gdrive/.stignore: permission denied
2021-03-27 16:48:10: Failed to create folder root directory stat /mnt/gdrive: permission denied
2021-03-27 16:48:10: Error on folder “gdrive” (wrgj5-dfhfj): stat /mnt/gdrive: permission denied

Thank you.

if you followed the guide and created the rclone@.service service file, you should be able to start the service like

systemctl --user start rclone@gdrive

To have the service running on boot, it would need to be enabled. This will create the sym link automatically

systemctl --user enable rclone@gdrive

Syncthing is executed as user dietpi. Therefore you would need to allow r/w access to this user to /mnt/gdrive/