디렉토리 목록을 웹 서버와 동기화

디렉토리 목록을 웹 서버와 동기화

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.

답변2

rsync와 유사하지만 다음을 사용합니다.동기화httpd 서버에서 가져옵니다.

관련 정보