You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be really handy if there was a mount.rclone wrapper that can be used in /etc/fstab. It would need to accept all the usual paremeters using slightly different syntax, e.g.
rclone --max-read-ahead 4M --read-only --config /path/to/config mount foo:/bar baz
would need to be expressed to the mount helper as:
And, of course, mount.rclone would have to wait until the fs has completed mounting and then go into the background.
Perhaps this could be done by making rclone check whether the binary name it was invoked as is mount.rclone, and if so, alter it's parameter format expectations?
Reacted by darkdragon-001, Blaok, Michael G, Ivan Andreev, pemontto, Andre Kutianski, jtagcat and Fusion future
I think this could be achieved by detecting the name of the binary as you say then doing textual manipulation of the -o parameters to make the as per what rclone normally requires.
This should work for rclonefs helper until the functionality is folded into the rclone binary:
#!/bin/sh
src=$1
dst=$2
shift 2
# Process -o parameters
while getopts :o: opts; do
case $opts in
o)
parms=`echo $OPTARG | sed -e 's/,/ /g'`
for parm in $parms; do
if [ $parm == "rw" ]; then continue; fi
if [ $parm == "dev" ]; then continue; fi
if [ $parm == "suid" ]; then continue; fi
if [ $parm == "exec" ]; then continue; fi
if [ $parm == "noexec" ]; then continue; fi
if [ $parm == "nosuid" ]; then continue; fi
if [ $parm == "nodev" ]; then continue; fi
trans="$trans --$parm"
done
;;
\?)
echo "Invalid option: -$OPTARG"
;;
esac
done
trans="$trans $src $dst"
PATH=$PATH rclone mount $trans &
sleep 5
I have tested this and "it works for me".
Obviously, change the path to your config appropriately, and the name of the remote (in the above case "crypt" and the paths.
Important:
rclonefs wrapper has to be in the PATH=/usr/local/bin:/usr/bin. mount is suid and doesn't ignores pre-set PATHs.
Similarly, rclone invocation fails to find fusermount if not invoked with PATH=$PATH explicitly set.
Activity
ncw commentedon Jan 9, 2017
Nice idea.
I think this could be achieved by detecting the name of the binary as you say then doing textual manipulation of the
-o parametersto make the as per what rclone normally requires.note putting rclone in the background is #723
gordan-bobic commentedon Jan 13, 2017
This should work for rclonefs helper until the functionality is folded into the rclone binary:
Then in fstab:
rclonefs#crypt:/path /mnt/tmp fuse config=/home/user/.rclone.conf,allow-other,default-permissions,read-only,max-read-ahead=16M 0 0I have tested this and "it works for me".
Obviously, change the path to your config appropriately, and the name of the remote (in the above case "crypt" and the paths.
Important:
gordan-bobic commentedon Jan 21, 2017
Now on the wiki: https://github.com/ncw/rclone/wiki/rclone-fstab-mount-helper-script
ncw commentedon Feb 11, 2017
I'll try to do this for the 1.37 release...
Or unless anyone else wants to have a go?
44 remaining items
ivandeex commentedon Oct 2, 2021
Since version 1.57 on rclone can act as a mount helper on its own. See updated https://github.com/rclone/rclone/wiki/rclone-mount-helper-script
cmd: make rclone work as rclone.mount rclone#992 - UNFINISHED