FTP를 통해 특정 날짜 범위의 파일을 전송할 수 있습니까?

FTP를 통해 특정 날짜 범위의 파일을 전송할 수 있습니까?

FTP 서버에서 새 서버로 많은 수의 파일을 전송해야 합니다. 수천 개의 파일이 있을 수 있으므로 지난 3개월 동안 업로드된 파일로 제한하고 싶습니다. 가능하다면 어떻게 해야 합니까?

또한 실제로 다운로드를 시작하기 전에 다운로드 크기가 얼마나 될지 알아내는 것이 가능합니까?

감사해요

답변1

당신이 사용할 수있는lftp이를 위해 mirror명령을 활용합니다. 맨페이지의 일부 내용은 다음과 같습니다.

  mirror [OPTS] [source [target]]

   Mirror specified source directory to local target directory. If target
   directory  ends  with  a  slash,  the source base name is appended to 
   target directory name. Source and/or target can be URLs pointing to 
   directories.


[cut...]
        -N, --newer-than=SPEC    download only files newer than specified time
            --on-change=CMD      execute the command if anything has been changed
            --older-than=SPEC    download only files older than specified time
[...]

예 를 들어 mirror- like --allow-chown등 의 유용한 옵션이 정말 많기 때문에 매뉴얼을 꼭 살펴보십시오 . Lftp는 또는 같은 다른 액세스 프로토콜과도 작동합니다 .--allow-suid--parallel[=N]sftpfishhttp(s)

답변2

다음을 사용하여 파일 시스템으로 마운트해 볼 수 있습니다.curlftpfs.
그런 다음 를 사용하여 복사합니다 find.
예:

mkdir /tmp/mountpoint
curlftpfs ftp://example.com/ /tmp/mountpoint/
cd /tmp/mountpoint
find -mtime +90 -exec cp {} /dest/path/ \;

더 나은 솔루션이 존재한다고 생각합니다.

관련 정보