Len*_*oyt 16 http synchronization
有没有一种简单的方法可以通过 HTTP 使文件夹与目录列表保持同步?
编辑:
感谢 wget 的提示!我创建了一个 shell 脚本并将其添加为 cron 作业:
remote_dirs=( "http://example.com/" "…") # Add your remote HTTP directories here
local_dirs=( "~/examplecom" "…")
for (( i = 0 ; i < ${#local_dirs[@]} ; i++ )) do
cd "${local_dirs[$i]}"
wget -r -l1 --no-parent -A "*.pdf" -nd -nc ${remote_dirs[$i]}
done
# Explanation:
# -r to download recursively
# -l1 to include only one directory depth
# --no-parent to exclude parent directories
# -A "*.pdf" to accept only .pdf files
# -nd to prevent wget to create directories for everything
# -N to make wget to download only new files
Run Code Online (Sandbox Code Playgroud)
编辑 2:
如下所述,也可以使用--mirror( -m),这是-r -N.
Geo*_*e M 19
wget 是一个很棒的工具。
用 wget -m http://somesite.com/directory
-m
--mirror
Turn on options suitable for mirroring. This option turns on
recursion and time-stamping, sets infinite recursion depth and
keeps FTP directory listings. It is currently equivalent to
-r -N -l inf --no-remove-listing.
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
21827 次 |
| 最近记录: |