Skip to content

Instantly share code, notes, and snippets.

@csereno
Created November 3, 2019 22:18
Show Gist options
  • Save csereno/8c01e4014f127076396355c1be5b7d70 to your computer and use it in GitHub Desktop.
Save csereno/8c01e4014f127076396355c1be5b7d70 to your computer and use it in GitHub Desktop.

Revisions

  1. csereno created this gist Nov 3, 2019.
    29 changes: 29 additions & 0 deletions rclone-unifi.service
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    # /etc/systemd/system/rclone-unifi.service
    [Unit]
    Description=Unifi S3 Sync (rclone)
    Wants=network-online.target
    After=network-online.target

    [Service]
    Type=notify
    User=unifi-video
    Group=unifi-video

    ExecStart=/usr/bin/rclone mount unifi-cams:unifi-cams /media/UnifiCams \
    --config=/usr/lib/unifi-video/.config/rclone/rclone.conf \
    --dir-cache-time=160h \
    --fuse-flag sync_read \
    --tpslimit 10 \
    --tpslimit-burst 10 \
    --buffer-size=64M \
    --attr-timeout=1s \
    --vfs-read-chunk-size=2M \
    --vfs-read-chunk-size-limit=2G \
    --vfs-cache-max-age=5m \
    --vfs-cache-mode=writes \
    --allow-non-empty
    ExecStop=/bin/fusermount -u /usr/lib/unifi-video/
    Restart=on-failure

    [Install]
    WantedBy=default.target