【问题标题】:Transfer directories through FTP but just images and videos通过 FTP 传输目录,但仅传输图像和视频
【发布时间】:2019-07-31 06:34:09
【问题描述】:

你能帮我一个命令通过 ftp 图像发送到远程目录吗...例如我有这个文件系统:

/directory
    image.png
    index.php
    index.html
    video.mpeg
/directory2
    image.jpg
    index.html
/directory3
    /directory
        index.html
        image.jpg

当我运行命令时,我只想传输具有特定扩展名的文件(现在是 jpg、png 和 mpeg),所以我希望远程文件夹的结果是:

/directory
    image.png
    video.mpeg
/directory2
    image.jpg
/directory3
    /directory
        image.jpg

有没有什么命令可以做到这一点?

【问题讨论】:

    标签: linux ftp command


    【解决方案1】:

    假设这些只是通用的 *nix 系统,那么 rsyncftp 更适合这种任务,例如

    rsync -av path/ remote-system:path/ --include \*/ --include \*.jpg --include \*.png --include \*.mpeg --exclude \*
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-01-26
      • 1970-01-01
      相关资源
      最近更新 更多