Auto mount on reboot

hello
i have mounted my google drive and cache no encryption to my ubuntu quickbox.
but every time i reboot i lose my mounts any help ?

here is what i used:
rclone mount -vvv --allow-other --allow-non-empty gsuite: /home/user/gsuite
rclone mount -vvv --allow-other --allow-non-empty gcache: /home/user/gcache

Do you have a service which mounts it on reboot or a cron job? Without it, it won’t be automatically mounted.

no i don’t
how can i do this ?

start reading about systemd services.
Simply read the systemd google hits

i did google it before posting here and it is not easy from me i have never used Linux before only windows

There is a basic systemd file on the rclone wiki which may help.

create service

nano /etc/systemd/system/changeME.service

past this inside

/etc/systemd/system/changeME.service

[Unit]
Description=changeME Drive (rclone)
AssertPathIsDirectory=/var/www/changeME
After=lighttpd.service

[Service]
Type=simple
ExecStart=/usr/bin/rclone mount
--config=/root/.config/rclone/rclone.conf
--allow-other
--cache-tmp-upload-path=/tmp/rclone/upload
--cache-chunk-path=/tmp/rclone/chunks
--cache-workers=8
--cache-writes
--cache-dir=/tmp/rclone/vfs
--cache-db-path=/tmp/rclone/db
--no-modtime
--drive-use-trash
--stats=0
--checkers=16
--bwlimit=40M
--dir-cache-time=60m
--cache-info-age=60m changeME:/ /var/www/changeME
ExecStop=/bin/fusermount -u /var/www/changeME
Restart=always
RestartSec=10

[Install]
WantedBy=default.target

=============-=-=-=-=-= to start
systemctl start changeME
systemctl enable changeME

anything that says ChangeME, make it so it reflects your own settings on your server.

make sure you have apt-get install fuse -y installed

2 Likes