![使用 wget 时出现“无法写入”错误](https://linux22.com/image/160296/%E4%BD%BF%E7%94%A8%20wget%20%E6%97%B6%E5%87%BA%E7%8E%B0%E2%80%9C%E6%97%A0%E6%B3%95%E5%86%99%E5%85%A5%E2%80%9D%E9%94%99%E8%AF%AF.png)
我想制作一个下载 SharePoint 文件夹内容的备份脚本。我使用 wget 得到了一个工作命令(当之前登录并导出 cookie.txt 时),使用以下命令:
wget --cookies=on --load-cookies cookies-portal-holding-lknoe-at.txt --keep-session-cookies --no-check-certificate -N -r -l 10 -np -R "index.html*" https://sharepoint.url/path/Freigegebene%20Dokumente/Foldername
选项有:
-N to turn on timestamping
-R to exclude index.html
-r -l 10 to download 10 recursive levels
-np to start with the child of the specified path
当目标文件夹不存在时,该命令按预期工作。当它确实存在时,会显示以下错误:
sharepoint.url/path/Freigegebene%20Dokumente/Foldername: Is a directory
Cannot write to sharepoint.url/path/Freigegebene%20Dokumente/Foldername (Success).
我没有用完磁盘空间...有什么想法吗?
答案1
您缺少目录末尾的“/”。尝试:
wget --cookies=on --load-cookies cookies-portal-holding-lknoe-at.txt --keep-session-cookies --no-check-certificate -N -r -l 10 -np -R "index.html*" https://sharepoint.url/path/Freigegebene%20Dokumente/Foldername/