Synology Rclone Google Drive Mount on Startup

What is the problem you are having with rclone?

I am attempting to get Rclone to mount my Google Drive automatically using Task Scheduler.
I setup a task to run on boot from root user of synology. If I manually run the task using task scheduler it has no trouble.
If I restart server so that task should fire on its on it does not mount properly.

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

rclone v1.57.0

  • os/version: unknown
  • os/kernel: 4.4.180+ (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.17.2
  • 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)

#!/bin/bash
/usr/bin/rclone mount google: /volume1/data/gdrive --config /volume1/homes/Nicholas/.config/rclone/rclone.conf --log-level=DEBUG --log-file=/volume1/data/scripts/rclone.log --buffer-size=512M --allow-other --allow-non-empty &

The rclone config contents with secrets removed.

[google]
type = drive
client_id = 206768705387-ueg4a4ami4nl8nq20q5a5a2ovpa2d1ke.apps.googleusercontent.com
client_secret = 
scope = drive
root_folder_id = 0AKFVM08xlbSJUk9PVA
token = {"access_token":""}
team_drive = 




A log from the command with the -vv flag

2022/02/18 15:45:58 DEBUG : rclone: Version "v1.57.0" starting with parameters ["/usr/bin/rclone" "mount" "google:" "/volume1/data/gdrive" "--config" "/volume1/homes/Nicholas/.config/rclone/rclone.conf" "--log-level=DEBUG" "--log-file=/volume1/data/scripts/rclone.log" "--buffer-size=512M" "--allow-other" "--allow-non-empty"]
2022/02/18 15:45:58 DEBUG : Creating backend with remote "google:"
2022/02/18 15:45:58 DEBUG : Using config file from "/volume1/homes/Nicholas/.config/rclone/rclone.conf"
2022/02/18 15:45:58 DEBUG : google: Loaded invalid token from config file - ignoring
2022/02/18 15:45:58 DEBUG : Saving config "token" in section "google" of the config file
2022/02/18 15:45:59 DEBUG : Keeping previous permissions for config file: -rwxrwxrwx
2022/02/18 15:45:59 DEBUG : google: Saved new token in config file
2022/02/18 15:45:59 DEBUG : Google drive root '': Mounting on "/volume1/data/gdrive"
2022/02/18 15:45:59 mount helper error: fusermount: fuse device not found, try 'modprobe fuse' first
2022/02/18 15:45:59 Fatal error: failed to mount FUSE fs: fusermount: exit status 1
2022/02/18 16:04:09 DEBUG : rclone: Version "v1.57.0" starting with parameters ["/usr/bin/rclone" "mount" "google:" "/volume1/data/gdrive" "--config" "/volume1/homes/Nicholas/.config/rclone/rclone.conf" "--log-level=DEBUG" "--log-file=/volume1/data/scripts/rclone.log" "--daemon" "--buffer-size=512M" "--allow-other" "--allow-non-empty"]
2022/02/18 16:04:09 DEBUG : Creating backend with remote "google:"
2022/02/18 16:04:09 DEBUG : Using config file from "/volume1/homes/Nicholas/.config/rclone/rclone.conf"
2022/02/18 16:04:09 DEBUG : rclone: Version "v1.57.0" starting with parameters ["/usr/bin/rclone" "mount" "google:" "/volume1/data/gdrive" "--config" "/volume1/homes/Nicholas/.config/rclone/rclone.conf" "--log-level=DEBUG" "--log-file=/volume1/data/scripts/rclone.log" "--daemon" "--buffer-size=512M" "--allow-other" "--allow-non-empty"]
2022/02/18 16:04:09 DEBUG : Creating backend with remote "google:"
2022/02/18 16:04:09 DEBUG : Using config file from "/volume1/homes/Nicholas/.config/rclone/rclone.conf"
2022/02/18 16:04:09 DEBUG : Google drive root '': Mounting on "/volume1/data/gdrive"
2022/02/18 16:04:09 mount helper error: fusermount: fuse device not found, try 'modprobe fuse' first
2022/02/18 16:04:09 Fatal error: failed to mount FUSE fs: fusermount: exit status 1

hello and welcome to the forum,

for that config file, make sure you have redacted/deleted any id/secret/tokens/etc..

i have a synbox and rclone mount works well.

try 'modprobe fuse' first
run that command and post the output

It just spits out the new prompt.

Nicholas@Marlin:~$ modprobe fuse
Nicholas@Marlin:~$

If I go into Task Scheduler and run the task manually I can access drive perfectly as expected.

Log after syno restart.
'''
2022/02/18 16:04:09 DEBUG : rclone: Version "v1.57.0" starting with parameters ["/usr/bin/rclone" "mount" "google:" "/volume1/data/gdrive" "--config" "/volume1/homes/Nicholas/.config/rclone/rclone.conf" "--log-level=DEBUG" "--log-file=/volume1/data/scripts/rclone.log" "--daemon" "--buffer-size=512M" "--allow-other" "--allow-non-empty"]
2022/02/18 16:04:09 DEBUG : Creating backend with remote "google:"
2022/02/18 16:04:09 DEBUG : Using config file from "/volume1/homes/Nicholas/.config/rclone/rclone.conf"
2022/02/18 16:04:09 DEBUG : rclone: Version "v1.57.0" starting with parameters ["/usr/bin/rclone" "mount" "google:" "/volume1/data/gdrive" "--config" "/volume1/homes/Nicholas/.config/rclone/rclone.conf" "--log-level=DEBUG" "--log-file=/volume1/data/scripts/rclone.log" "--daemon" "--buffer-size=512M" "--allow-other" "--allow-non-empty"]
2022/02/18 16:04:09 DEBUG : Creating backend with remote "google:"
2022/02/18 16:04:09 DEBUG : Using config file from "/volume1/homes/Nicholas/.config/rclone/rclone.conf"
2022/02/18 16:04:09 DEBUG : Google drive root '': Mounting on "/volume1/data/gdrive"
2022/02/18 16:04:09 mount helper error: fusermount: fuse device not found, try 'modprobe fuse' first
2022/02/18 16:04:09 Fatal error: failed to mount FUSE fs: fusermount: exit status 1
2022/02/18 16:05:09 DEBUG : Daemon timed out. Terminating daemon pid 10279
2022/02/18 16:05:09 Fatal error: mount not ready
'''

Log when task fired manually
'''
2022/02/18 16:26:11 DEBUG : rclone: Version "v1.57.0" starting with parameters ["/usr/bin/rclone" "mount" "google:" "/volume1/data/gdrive" "--config" "/volume1/homes/Nicholas/.config/rclone/rclone.conf" "--log-level=DEBUG" "--log-file=/volume1/data/scripts/rclone.log" "--buffer-size=512M" "--allow-other" "--allow-non-empty"]
2022/02/18 16:26:11 DEBUG : Creating backend with remote "google:"
2022/02/18 16:26:11 DEBUG : Using config file from "/volume1/homes/Nicholas/.config/rclone/rclone.conf"
2022/02/18 16:26:11 DEBUG : Google drive root '': Mounting on "/volume1/data/gdrive"
2022/02/18 16:26:11 DEBUG : : Root:
2022/02/18 16:26:11 DEBUG : : >Root: node=/, err=
'''

--- from the terminal command line, as root, can you run the rclone mount command?
--- change your script to include a modprobe fuse, save that to a text file

I am sorry, I am not sure what I would add to my script to include a modprobe fuse. I am also not sure what my synology root password is..

This is what is in mountrclone.sh
#!/bin/bash
/usr/bin/rclone mount google: /volume1/data/gdrive --config /volume1/homes/Nicholas/.config/rclone/rclone.conf --log-level=DEBUG --log-file=/volume1/data/scripts/rclone.log --buffer-size=512M --allow-other --allow-non-empty &

Also if this helps. This is the log from the Task Scheduler:

2022/02/18 16:26:11 DEBUG : Home directory lookup failed and cannot be used as configuration location: exec: "getent": executable file not found in $PATH

from the command line, as root, can you run your script?

I am not sure what my root password is to login to root user in putty.

why are you running rclone mount as root, is there a specific reason?

do not need root password, use your password for username

user99@bnas:~$ sudo -i
Password:
root@bnas:~#

Nicholas@Marlin:~$ sudo -i
Password:
root@Marlin:~# /usr/bin/rclone mount google: /volume1/data/gdrive --config /volume1/homes/Nicholas/.config/rclone/rclone.conf --log-level=DEBUG --log-file=/volume1/data/scripts/rclone.log --buffer-size=512M --allow-other --allow-non-empty &
[1] 17054
root@Marlin:~#

I can see my drive mounted successfully as well. I can confirm it mounts perfectly fine using the root user on the command line. Just not when I set it up as a boot process using the root user?

if the boot process is run as your username, not root, does it work?

and why are you running as root, what is the reason for that?

I am not running the boot task as root for any particular reason. It was a mishmash of guides.

I will change it now to run the task under my username Nicholas and show the logs.

General:
Mount Rclone
User : Nicholas

Task Settings
User-Defined script
bash /volume1/data/scripts/mountrclone.sh

Mountrclone.sh file has this in it ***

#!/bin/bash
/usr/bin/rclone mount google: /volume1/data/gdrive --config /volume1/homes/Nicholas/.config/rclone/rclone.conf --log-level=DEBUG --log-file=/volume1/data/scripts/rclone.log --buffer-size=512M --allow-other --allow-non-empty &

When I set the startup command under my username this is the log:

2022/02/18 17:09:24 DEBUG : Google drive root '': Checking for changes on remote
2022/02/18 17:09:35 DEBUG : /volume1/data/gdrive: Unmounted externally. Just exit now.
2022/02/18 17:09:35 DEBUG : rclone: Version "v1.57.0" finishing with parameters ["/usr/bin/rclone" "mount" "google:" "/volume1/data/gdrive" "--config" "/volume1/homes/Nicholas/.config/rclone/rclone.conf" "--log-level=DEBUG" "--log-file=/volume1/data/scripts/rclone.log" "--buffer-size=512M" "--allow-other" "--allow-non-empty"]
2022/02/18 17:11:19 DEBUG : rclone: Version "v1.57.0" starting with parameters ["/usr/bin/rclone" "mount" "google:" "/volume1/data/gdrive" "--config" "/volume1/homes/Nicholas/.config/rclone/rclone.conf" "--log-level=DEBUG" "--log-file=/volume1/data/scripts/rclone.log" "--buffer-size=512M" "--allow-other" "--allow-non-empty"]
2022/02/18 17:11:19 DEBUG : Creating backend with remote "google:"
2022/02/18 17:11:19 Failed to load config file "/volume1/homes/Nicholas/.config/rclone/rclone.conf": open /volume1/homes/Nicholas/.config/rclone/rclone.conf: permission denied

This is the log from the startup
2022/02/18 17:11:19 DEBUG : Home directory lookup failed and cannot be used as configuration location: exec: "getent": executable file not found in $PATH

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