ディレクトリリストをWebサーバーと同期

ディレクトリリストをWebサーバーと同期

HTTP経由でフォルダをディレクトリリストと同期したままにする簡単な方法はありますか?

編集する:

ヒントをくれたwgetに感謝!シェルスクリプトを作成し、それを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

編集2:以下の説明のようにの略語--mirror()も使用できます。-m-r -N

ベストアンサー1

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.

おすすめ記事