Is there an easy way to keep a folder synced with a directory listing via HTTP?
Edit:
Thanks for the tip with wget! I created a shell script and added it as a cron job:
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
Edit 2:
As mentioned below one could also use --mirror
(-m
), which is the shorthand for -r -N
.