# Rclone and mount with check

**URL:** <https://forum.rclone.org/t/rclone-and-mount-with-check/12847>\
**Category:** Help and Support\
**Created:** [November 10, 2019, 9:48am UTC](https://forum.rclone.org/t/rclone-and-mount-with-check/12847 "2019-11-10T09:48:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ale82x](https://forum.rclone.org/user_avatar/forum.rclone.org/ale82x/32/1610_2.png) [@ale82x](https://forum.rclone.org/u/ale82x)\
**Post date:** [November 10, 2019, 9:48am UTC](https://forum.rclone.org/t/rclone-and-mount-with-check/12847/1 "2019-11-10T09:48:30Z")

</div>

Hello,  
i'm using rclone and work very well.

i need to mount my remote (Google Drive) to a folder for backup my server.

i don't undestand use of /etc/fstab so i use this scipt on crontab

```auto
* * * * * df | /usr/bin/grep /mnt/gdrive > /dev/null 2>&1 || /usr/bin/fusermount -u -z /mnt/gdrive ; nohup /usr/bin/rclone --vfs-cache-mode minimal mount my-remote:/my/remote/path /mnt/gdrive > /dev/null 2>&1

```

pratically check if /mnt/gdrive is a mount point and if not force dismount and remount it.  
work very well and i have a normal consuption of cpu/ram  
but when i try top and grep rclone i find ever 2 processes...

one is normal process for mount

other is  
/bin/sh -c df | /usr/bin/grep /mnt/gdrive \> /dev/null 2\>&1 || /usr/bin/fusermount -u -z /mnt/gdrive ; nohup /usr/bin/rclone --vfs-cache-mode minimal mount my-remote:/my/remote/path /mnt/gdrive \> /dev/null 2\>&1  
is normal?

can you help me to improve script?  
i need to setup on @reboot (or every minute is ok) and every minute check if /mnt/gdrive is mounted...

thank you

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [November 10, 2019, 10:47am UTC](https://forum.rclone.org/t/rclone-and-mount-with-check/12847/2 "2019-11-10T10:47:15Z")

</div>

You'd probably be better starting the rclone mount with systemd which will restart it if it dies.

Here is an example: [https://www.jamescoyle.net/how-to/3116-rclone-systemd-startup-mount-script](https://www.jamescoyle.net/how-to/3116-rclone-systemd-startup-mount-script)

---

<div class="post-metadata">

**Author:** ![ale82x](https://forum.rclone.org/user_avatar/forum.rclone.org/ale82x/32/1610_2.png) [@ale82x](https://forum.rclone.org/u/ale82x)\
**Post date:** [November 10, 2019, 11:00pm UTC](https://forum.rclone.org/t/rclone-and-mount-with-check/12847/3 "2019-11-10T23:00:10Z")

</div>

wow, thank you.  
i find that very helpful and i edit with  
--vfs-cache-mode=minimal  
for minor consuption...

last thing.  
for check if all ok is correct create a cron like this

> 0,10,20,30,40,50 \* \* \* \* if ["$(ps ax|grep -v grep|grep rclone|wc -l)" == "0"];then systemctl restart rclone;fi \> /dev/null 2\>&1

thank you

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [November 11, 2019, 9:05am UTC](https://forum.rclone.org/t/rclone-and-mount-with-check/12847/4 "2019-11-11T09:05:35Z")

</div>

> [@ale82x](#):
>
> for check if all ok is correct create a cron like this

You shouldn't need that - `systemd` will restart rclone because of these lines

```auto
Restart=always
RestartSec=10

```

---

<div class="post-metadata">

**Author:** ![ale82x](https://forum.rclone.org/user_avatar/forum.rclone.org/ale82x/32/1610_2.png) [@ale82x](https://forum.rclone.org/u/ale82x)\
**Post date:** [November 11, 2019, 9:18am UTC](https://forum.rclone.org/t/rclone-and-mount-with-check/12847/5 "2019-11-11T09:18:16Z")

</div>

sorry,  
ok

thank you again

---

<div class="post-metadata">

**Author:** ![system](https://forum.rclone.org/uploads/default/original/2X/3/39ad3235f6ffec76ccd0c81616bd55697b4c300d.png) [@system](https://forum.rclone.org/u/system)\
**Post date:** [February 9, 2020, 9:18am UTC](https://forum.rclone.org/t/rclone-and-mount-with-check/12847/6 "2020-02-09T09:18:20Z")

</div>

Closed on February 9, 2020, 9:18am UTC

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