Script and cronjob to remount

Hi guys,

I am looking for creating a cron to remount my mounted folders when unmounted, I’ve been trying to figure out reading the forum but couldn’t manage to make anything working.
I’ve got two remotes and I would like the cron check if they are mounted every 15 minutes
When I do mount them I do it with the following commands

rclone mount remote:/P /volume2/Plex/Library/mount/ --allow-non-empty --allow-other --read-only --max-read-ahead 200M --dir-cache-time 30m --checkers 3 &
rclone mount remote2:/S /volume2/Plex/Library/mount2/ --allow-non-empty --allow-other --read-only --max-read-ahead 200M --dir-cache-time 30m --checkers 3 &

Any help on creating the script and cron would be really appreciated :slight_smile:

Check this repo out

https://github.com/ajkis/scripts

1 Like

Thanks for the info, I will have a look :wink:

You can use this script:
https://github.com/ajkis/scripts/blob/master/rclone/rclone-mount.cron

Just change paths and make sure you make a check file

1 Like

I am testing exactly that one, I have modified the paths and created the mountcheck file and if unmounted just to test
1st attempt I get

ERROR: Drive not mounted, remount in progress.
CRITICAL: Remount failed.

But then I run it again it is actually been remounted and accesible

INFO: Check successful,remote mounted.

Really weird :sweat_smile: