PortValhalla/scripts/Common/Config/rclone/rclone@.service

27 lines
710 B
SYSTEMD
Raw Normal View History

2022-11-10 17:24:02 +00:00
[Unit]
Description=rclone: Remote FUSE filesystem for cloud storage config %i
Documentation=man:rclone(1)
[Service]
Type=notify
Environment="EXPRESSION=%i"
ExecStart= \
bash -c ' \
target="${EXPRESSION%%":"*}"; \
dirname="${EXPRESSION#*":"}"; \
2023-05-03 16:31:38 +00:00
destination="%h/.mnt/$dirname"; \
mkdir -p "$destination"; \
2022-11-10 17:24:02 +00:00
mkdir -p /tmp/rclone; \
/usr/bin/rclone mount \
--config=%h/.config/rclone/rclone.conf \
--vfs-cache-mode full \
--log-file /tmp/rclone/$target.log \
2023-05-03 16:31:38 +00:00
$target: "$destination";'
2022-11-11 08:08:41 +00:00
ExecStop=bash -c '/bin/fusermount -zu "%h/${EXPRESSION#*":"}"'
2022-11-10 17:24:02 +00:00
2023-04-07 12:49:41 +00:00
Restart=always
RestartSec=10
2023-04-07 14:26:32 +00:00
[Install]
WantedBy=rclone.target