WEBDAV mount unit

WEBDAV


See the Arch wiki on webdav. Install davfs2 from the repo

Edit the file /etc/davfs2/secrets and append your webdav service and credentials

http(s)://address:<port>/path    davusername    "davpassword"

Or create a user file at ~/.davfs2/secrets for user specific mounts

mount unit

Name the file according to $YOUR_MOUNT_PATH.mount

[Unit]
Description=Mount WebDAV Service on server https://host:port/path
Wants=network-online.service

[Mount]
What=http(s)://address:<port>/path
Where=$YOUR_MOUNT_PATH
Options=rw,_netdev
Type=davfs
TimeoutSec=15

[Install]
WantedBy=remote-fs.target
WantedBy=multi-user.target

automount unit

Name the file according to $YOUR_MOUNT_PATH.automount

[Unit]
Description=Mount WebDAV Service
ConditionPathExists=$YOUR_MOUNT_PATH

[Automount]
Where=$YOUR_MOUNT_PATH
TimeoutIdleSec=300

[Install]
WantedBy=multi-user.target