bash-使用 lftp 从远程文件夹镜像特定文件

bash-使用 lftp 从远程文件夹镜像特定文件

我想通过 ftp 从远程目录镜像文件。

以下代码有效:

lftp -c 'open ipaddress; user myusername mypassword; mirror -e /files/ /home/user/files/retrieve/; quit'

但是,我希望能够指定我需要检索的文件的年龄和大小,例如mtime -2 and -size +10M

我应该在哪里添加这些值?

答案1

我最终做了以下事情:

lftp -c 'open ipaddress; user myusername mypassword; mirror -r -N now-2days /files/ /home/user/files/retrieve/; quit'

在哪里

-r是‘不要进入子目录’;
-N是‘最近 2 天内更新或创建的文件’

相关内容