markboy's archive
Create TOC
2024년 12월 14일
Debian/systemd로 rclone mount하기
rclone mount를 autofs 대신 systemd를 사용하는 방법을 기술한다. rclone은 미리 설정했다고 가정한다. *~/.config/systemd/user/rclone@.service*파일을 만든다. ```ini # User service for Rclone mounting # # Place in ~/.config/systemd/user/ # File must include the '@' (ex rclone@.service) # As your normal user, run # systemctl --user daemon-reload # You can now start/enable each remote by using rclone@
# systemctl --user enable --now rclone@dropbox [Unit] Description=rclone: Remote FUSE filesystem for cloud storage config %i Documentation=man:rclone(1) After=network-online.target--u Wants=network-online.target [Service] Type=notify ExecStartPre=-/usr/bin/mkdir -p %h/mnt/%i ExecStart= \ /usr/bin/rclone mount \ --config=%h/.config/rclone/rclone.conf \ --allow-non-empty \ --vfs-cache-mode writes \ --vfs-cache-max-size 100M \ --dir-cache-time 72h \ --vfs-read-chunk-size-limit 128M \ --vfs-read-chunk-size-limit off \ --log-level INFO \ --log-file /tmp/rclone-%i.log \ %i: %h/mnt/%i ExecStop=/bin/fusermount -u %h/mnt/%i [Install] WantedBy=default.target ``` **--allow-other** 설정을 추가하고 싶다면 */etc/fuse.conf* 파일에 **user_allow_other**을 추가한다. 서비스 설정을 다시 읽는다. ```shell $ systemctl --user daemon-reloaded ``` rclone에서 설정한 remote 이름과 결합해서 서비스를 등록하고 시작한다. remote이름이 onedrive 라면 ```shell $ systemctl --user enable --now rclone@onedrive ```
최근 게시물
이전 게시물
홈
피드 구독하기:
글 ( Atom )