Auto Mount Google Drive Synology

I SSH and apply the following command to mount my Google Drive.

/usr/bin/rclone mount -v gDrive: /volume1/homes/admin/googledrive --allow-other --dir-cache-time 672h --vfs-cache-max-age 675h --vfs-read-chunk-size 64M --vfs-read-chunk-size-limit 1G --buffer-size 32M &

How do I get this to auto run when the NAS reboots? I have search for answers and keep coming up empty. Any help will be appreciated. Thank you in advance.

hello and welcome to the forum,

use the task scheduler under control panel.

I have tried that but it doesn't start it. How do I to get it to start.?

I am new to this so any help is appreciated. Please point me to where I can find information on how to do this. Thank you for your time

goto synology support website

I have this SSH command that works:

/usr/bin/rclone mount -v gDrive: /volume1/homes/admin/googledrive --allow-other --dir-cache-time 672h --vfs-cache-max-age 675h --vfs-read-chunk-size 64M --vfs-read-chunk-size-limit 1G --buffer-size 32M &

How do I get Task Scheduler to run it?

I have searched. When I get to a possible location, I have been met with a 404 error.

not sure what you mean?

When I have looked it up in forums there have been dead links so I get the 404 error. I will keep looking. Thank you for your time.

Follow this https://www.damirscorner.com/blog/posts/20190301-SchedulingATaskOnASynologyNas.html

Also make sure, you gave +x (execution right) to the sh file.

Regards

https://www.synology.com/en-us/knowledgebase/DSM/help/DSM/AdminCenter/system_taskscheduler

best bet is to post at synology support forum.

Create a bash script somewhere on your nas:

e.g:
/volume1/homes/admin/scripts/nas-mounter.sh

in this file add this:

#!/bin/bash
#!/usr/bin/rclone
# Make script executable with: chmod a+x /volume1/homes/admin/scripts/nas-mounter.sh

/usr/bin/rclone mount -v gDrive: /volume1/homes/admin/googledrive --allow-other --dir-cache-time 672h --vfs-cache-max-age 675h --vfs-read-chunk-size 64M --vfs-read-chunk-size-limit 1G --buffer-size 32M &

Then create a start up task that calls the script.

I have that entered but it will not auto run. I can execute from winscp but the task scheduler won't execute it.

bash /volume1/homes/admin/scripts/nas-mounter.sh

so you click the 'run' button and it does not run?
how do you know that the script did not run?
it could have run and failed with an error.

you should to add a debug log to rclone
add this to the command, click run and post the log file.
--log-level=DEBUG --log-file=/volume1/homes/admin/scripts/rclone.log

https://rclone.org/docs/#log-file-file
https://rclone.org/docs/#log-level-level

you can get an email notification after the task is run, that would have useful info in it.

In the task scheduler, which user is running the task.

Can you post screenshots of the 2 settings windows when you edit the task.

(You might need to specify the location of the config file)

can you post the script?

#!/bin/bash
/usr/bin/rclone mount -v remote2: /volume1/homes/admin/googledrive --allow-other --dir-cache-time 672h --vfs-cache-max-age 675h --vfs-read-chunk-size 64M --vfs-read-chunk-size-limit 1G --buffer-size 32M &

hmm, those windows look pretty much identical to mine...

maybe try checking the box to send you run details via email and see if there are any clues in there (and enable some logging as suggested above)