{"id":1729,"date":"2023-06-07T18:28:12","date_gmt":"2023-06-07T18:28:12","guid":{"rendered":"https:\/\/blog.kimi.ee\/?p=1729"},"modified":"2023-07-04T19:44:54","modified_gmt":"2023-07-04T19:44:54","slug":"%e3%80%90%e7%bd%91%e7%9b%98%e3%80%91davfs%e6%8a%8aalist%e7%9a%84%e7%bd%91%e7%9b%98%ef%bc%88%e5%a4%a9%e7%bf%bc%ef%bc%89%e9%80%9a%e8%bf%87webdav%e6%8c%82%e8%bd%bd%e5%88%b0vps%e6%88%96%e6%9c%ac%e5%9c%b0","status":"publish","type":"post","link":"https:\/\/blog.kimi.ee\/?p=1729","title":{"rendered":"\u3010\u7f51\u76d8\u3011davfs\u628aAlist\u7684\u7f51\u76d8\uff08\u5929\u7ffc\uff09\u901a\u8fc7Webdav\u6302\u8f7d\u5230vps\u6216\u672c\u5730\uff0c\u5e76\u914d\u7f6e\u5b9d\u5854\u81ea\u52a8\u5907\u4efd"},"content":{"rendered":"\n<p>\u5b89\u88c5davfs\uff0cfuse<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-plain\"><code>#centos\uff1a\nyum install davfs2\nyum install fuse\n\n#debian\napt install davfs2\napt-get update && apt-get install -y fuse\n\n\uff08\u6709\u4e9b\u65f6\u5019\u8fd8\u8981\u5b89\u88c5fuse3\uff09<\/code><\/pre><\/div>\n\n\n\n<p>\u65b0\u5efa\u6302\u8f7d\u4f4d\u7f6e\uff0c\u7ed9\u6743\u9650<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-plain\"><code>mkdir -p \/Backup\/VPS\u81ea\u52a8\u5907\u4efd\nchmod +x \/Backup\/VPS\u81ea\u52a8\u5907\u4efd<\/code><\/pre><\/div>\n\n\n\n<p>\u914d\u7f6eAlist\u7684webdav\u7684URL\u3001\u8d26\u53f7\u5bc6\u7801\uff08\u6ce8\u610f\u4e00\u5b9a\u8981\u6709\/dav\/\uff09\uff0c\u8def\u5f84\u662f\/etc\/davfs2\/secrets<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-plain\"><code>echo &quot;http:\/\/127.0.0.1:\u7aef\u53e3\/dav\/Tianyi\/VPS\u81ea\u52a8\u5907\u4efd Alist\u7ba1\u7406\u8d26\u53f7 \u5bc6\u7801&quot; &gt; \/etc\/davfs2\/secrets<\/code><\/pre><\/div>\n\n\n\n<p>\u914d\u7f6e\u81ea\u542f\u52a8\uff1a<\/p>\n\n\n\n<p>centos7\u7cfb\u7edf\uff1a<\/p>\n\n\n\n<p>\uff08\u683c\u5f0f\uff1a\u524d\u9762\u662fwebdav\u7684\u8def\u5f84\uff0c\u7a7a\u683c\u540e\u9762\u662f\u672c\u5730\u6302\u8f7d\u5230\u7684\u8def\u5f84\uff09\uff0c\u8def\u5f84\u662f\/etc\/rc.local<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-plain\"><code>echo &quot;mount -t davfs http:\/\/127.0.0.1:\u7aef\u53e3\/dav\/Tianyi\/VPS\u81ea\u52a8\u5907\u4efd \/Backup\/VPS\u81ea\u52a8\u5907\u4efd&quot; &gt;&gt; \/etc\/rc.local<\/code><\/pre><\/div>\n\n\n\n<p>Debian10\u7cfb\u7edf\uff1a<\/p>\n\n\n\n<p>\u7531\u4e8edebian10\u5f03\u7528\u4e86rc.local\u6587\u4ef6\uff0c\u4f7f\u7528systemd\u670d\u52a1\u7ba1\u7406\u81ea\u542f\u52a8\uff0c\u56e0\u6b64\u9700\u8981\u5982\u4e0b\u64cd\u4f5c\uff1a<\/p>\n\n\n\n<ul>\n<li>1.\u5728\/opt\u76ee\u5f55\u4e0b\u65b0\u5efa\u540d\u4e3amount.sh\u7684\u811a\u672c<\/li>\n<\/ul>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-plain\"><code>#!\/bin\/bash\nsleep 30\nmount -t davfs http:\/\/127.0.0.1:\u7aef\u53e3\/dav\/Tianyi\/VPS\u81ea\u52a8\u5907\u4efd \/Backup\/VPS\u81ea\u52a8\u5907\u4efd\n<\/code><\/pre><\/div>\n\n\n\n<ul>\n<li>2.\u4e3a\u8be5\u811a\u672c\u6587\u4ef6\u6dfb\u52a0\u53ef\u6267\u884c\u6743\u9650\uff1a<\/li>\n<\/ul>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-plain\"><code>chmod +x \/opt\/mount.sh<\/code><\/pre><\/div>\n\n\n\n<ul>\n<li>3.\u5728\u00a0<code>\/etc\/systemd\/system\/<\/code>\u00a0\u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2a\u65b0\u7684 systemd \u670d\u52a1\u6587\u4ef6\uff0c<code>mount-startup.service<\/code>\uff0c\u5e76\u5728\u5176\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/li>\n<\/ul>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-plain\"><code>[Unit]\nDescription=Mount davfs at startup\n\n[Service]\nType=simple\nExecStart=\/bin\/bash \/opt\/mount.sh\n\n[Install]\nWantedBy=multi-user.target<\/code><\/pre><\/div>\n\n\n\n<ul>\n<li>4.\u91cd\u65b0\u52a0\u8f7d systemd \u914d\u7f6e\uff1a<\/li>\n<\/ul>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-plain\"><code>systemctl daemon-reload<\/code><\/pre><\/div>\n\n\n\n<ul>\n<li>5.\u542f\u7528\u8be5\u670d\u52a1\u4ee5\u4f7f\u5176\u5728\u5f00\u673a\u65f6\u81ea\u52a8\u8fd0\u884c\uff1a<\/li>\n<\/ul>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-plain\"><code>systemctl enable mount-startup.service<\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>\u914d\u7f6efastab\uff1a<\/p>\n\n\n\n<p>\uff08\u683c\u5f0f\uff1a\u524d\u9762\u662fwebdav\u7684\u8def\u5f84\uff0c\u7a7a\u683c\u540e\u9762\u662f\u672c\u5730\u6302\u8f7d\u5230\u7684\u8def\u5f84\uff09\uff0c\u8def\u5f84\u662f\/etc\/fstab<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-plain\"><code>echo &quot;mount -t davfs http:\/\/127.0.0.1:\u7aef\u53e3\/dav\/Tianyi\/VPS\u81ea\u52a8\u5907\u4efd \/Backup\/VPS\u81ea\u52a8\u5907\u4efd  davfs defaults 0 0&quot; &gt;&gt; \/etc\/fstab<\/code><\/pre><\/div>\n\n\n\n<p>\u6302\u8f7d\u547d\u4ee4\uff1a<\/p>\n\n\n\n<p>\uff08\u683c\u5f0f\uff1a\u524d\u9762\u662fwebdav\u7684\u8def\u5f84\uff0c\u7a7a\u683c\u540e\u9762\u662f\u672c\u5730\u6302\u8f7d\u5230\u7684\u8def\u5f84\uff09<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-plain\"><code>mount -t davfs http:\/\/127.0.0.1:\u7aef\u53e3\/dav\/Tianyi\/VPS\u81ea\u52a8\u5907\u4efd \/Backup\/VPS\u81ea\u52a8\u5907\u4efd\n<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u5b89\u88c5davfs\uff0cfuse \u65b0\u5efa\u6302\u8f7d\u4f4d\u7f6e\uff0c &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"\u3010\u7f51\u76d8\u3011davfs\u628aAlist\u7684\u7f51\u76d8\uff08\u5929\u7ffc\uff09\u901a\u8fc7Webdav\u6302\u8f7d\u5230vps\u6216\u672c\u5730\uff0c\u5e76\u914d\u7f6e\u5b9d\u5854\u81ea\u52a8\u5907\u4efd\" class=\"read-more button\" href=\"https:\/\/blog.kimi.ee\/?p=1729#more-1729\">Read more<span class=\"screen-reader-text\">\u3010\u7f51\u76d8\u3011davfs\u628aAlist\u7684\u7f51\u76d8\uff08\u5929\u7ffc\uff09\u901a\u8fc7Webdav\u6302\u8f7d\u5230vps\u6216\u672c\u5730\uff0c\u5e76\u914d\u7f6e\u5b9d\u5854\u81ea\u52a8\u5907\u4efd<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[94,97,93,44,96,8,92],"_links":{"self":[{"href":"https:\/\/blog.kimi.ee\/index.php?rest_route=\/wp\/v2\/posts\/1729"}],"collection":[{"href":"https:\/\/blog.kimi.ee\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.kimi.ee\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.kimi.ee\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.kimi.ee\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1729"}],"version-history":[{"count":0,"href":"https:\/\/blog.kimi.ee\/index.php?rest_route=\/wp\/v2\/posts\/1729\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.kimi.ee\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1729"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.kimi.ee\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1729"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.kimi.ee\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1729"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}