我想制作一个下载 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/