Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

persistant mountpoint #129

Open
SJ50 opened this issue May 21, 2021 · 3 comments
Open

persistant mountpoint #129

SJ50 opened this issue May 21, 2021 · 3 comments

Comments

@SJ50
Copy link

SJ50 commented May 21, 2021

I am trying webui in docker and created mount point and it got mounted successfully. I can access files from host as well.
I like to know that how can I make mount point created via webui persistant so it can servive reboot.

@queltosh
Copy link

You only need to put the rclone mount commando in the "command" section in docker-compose or docker run. In that line you can also boot the web-gui.

@sjtuross
Copy link

sjtuross commented Feb 26, 2022

I achieved this by overriding the docker entrypoint with a bash script (e.g. bootstrap.sh). The benefit is that I can mount multiple remotes and do cleanup when it's down. One issue is that such mounts are not shown in web gui.

#!/bin/sh

cleanup() {
  fusermount -uzq /data/onedrive
  fusermount -uzq /data/gdrive
  fusermount -uzq /data/adrive
}

trap 'true' SIGTERM

cleanup
rclone mount onedrive: /data/onedrive --vfs-cache-mode writes --daemon
rclone mount gdrive: /data/gdrive --vfs-cache-mode writes --daemon
rclone mount adrive: /data/adrive --vfs-cache-mode writes --daemon
rclone rcd --cache-dir /cache --rc-web-gui --rc-addr :5572 --rc-web-gui-no-open-browser --rc-web-gui-update &

wait $!

cleanup
version: '2'

services:
  rclone:
    image: rclone/rclone:latest
    container_name: rclone
    restart: unless-stopped
    environment:
      RCLONE_RC_USER: admin
      RCLONE_RC_PASS: admin
    volumes:
      - ./config:/config/rclone
      - ./cache:/cache
      - ./data:/data:shared
      - /etc/passwd:/etc/passwd:ro
      - /etc/group:/etc/group:ro
    network_mode: bridge
    ports:
      - 5572:5572
    user: 1000:1000
    cap_add:
      - SYS_ADMIN
    devices:
      - /dev/fuse:/dev/fuse
    security_opt:
      - apparmor:unconfined
    entrypoint: /config/rclone/bootstrap.sh

@GottZ
Copy link

GottZ commented Jan 17, 2023

type rclone rc

this will print out the manual to use rc.

from there you can figure out that you could mount drives like this after launching rcd first:

windows:
rclone rc mount/mount fs=suchremote: mountPoint=X: vfsOpt="{"""CacheMode""":2}" mountOpt="{"""AllowOther""":true}" --user youruser --pass yourpassword

linux:
rclone rc mount/mount fs=suchremote: mountPoint=/mnt/x vfsOpt='{"CacheMode":2}' mountOpt='{"AllowOther":true}' --user youruser --pass yourpassword

so in essence just chain these rc commands after launching rcd and you are good to go and all the mounts are running within the rcd process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants