Last active
October 5, 2020 01:44
-
-
Save dbiesecke/eb264fa276921a1bd4c7f88e2a0bad9a to your computer and use it in GitHub Desktop.
Rclone Systemd Server with rcd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=rclone mount | |
AssertPathIsDirectory=/storage/rclone | |
After=network-online.service | |
Requires=network-online.service | |
Before=kodi.service | |
[Service] | |
Type=simple | |
ExecStart=/storage/bin/rclone rcd --rc-web-gui-no-open-browser \ | |
--cache-tmp-upload-path=/tmp/rclone/upload \ | |
--cache-chunk-path=/tmp/chunks \ | |
--cache-workers=8 \ | |
--cache-writes \ | |
--cache-dir=/storage/vfs \ | |
--cache-db-path=/storage/db \ | |
--config=/storage/.config/rclone/rclone.conf \ | |
--rc-user bob --rc-pass hacks --rc-web-gui --rc-addr=0.0.0.0:5572 --rc-serve --fast-list --transfers 40 --drive-skip-gdocs \ | |
--drive-server-side-across-configs \ | |
--use-server-modtime \ | |
--no-update-modtime \ | |
--fast-list \ | |
--stats=0 \ | |
--use-mmap \ | |
--checkers=16 \ | |
--bwlimit=40M | |
ExecStartPost=/storage/bin/rmount main /storage/rclone | |
ExecStop=/bin/fusermount -u /storage/rclone | |
Restart=always | |
RestartSec=10 | |
[Install] | |
WantedBy=default.target |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
function rmount() { | |
RC='--config=/storage/.config/rclone/rclone.conf --rc-user bob --rc-pass hacks --rc-addr 0.0.0.0:5572' | |
rclone=/storage/bin/rclone | |
if [ $# -ne 2 ]; then | |
echo "NOTE: \nUsage:\t rmount <remote> <mountpoint>" | |
fi | |
REMOTE=$1 | |
MT=$2 | |
fusermount -u -z "$MT" 2>/dev/null | |
#"BufferSize": 529980449 | |
# $rclone rc options/set --json '{ "main":{"BufferSize": 729980449 ,"NoGzip":true, "SizeOnly":true , "NoUpdateModTime": true , "MaxDepth":2,"Checkers":20 , "UseMmap": false } , "vfs":{"ChunkSize": 629980449 , "NoModTime":true,"Umask": 0,"DirCacheTime": 3600000000000000,"CacheMode": 0 } }' $RC | |
# $rclone rc options/set --json '{"filter":{"IgnoreCase":true , "ExcludeFrom": [ "/userdata/system/exclude" ] } }' $RC | |
test -d "$MT" || mkdir -p "$MT" | |
VFS='{"PollInterval": 15000000000,"Umask": 0,"DirCacheTime": 3600000000000000,"ChunkSize": 33554432,"CacheMode": 3}' | |
$rclone rc mount/mount fs=$REMOTE mountPoint=$MT vfsOpt="$VFS" mountOpt='{ "AllowRoot": true , "AllowOther": true , "FastList": true , "AllowNonEmpty": true }' $RC # --rc-user bob --rc-pass hacks --rc-addr "0.0.0.0:5572" | |
} | |
rmount "$1" "$2" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment