【问题标题】:How to rclone copy only .png files under a directory?如何rclone仅复制目录下的.png文件?
【发布时间】:2021-07-09 07:54:53
【问题描述】:

我在服务器的 dir1/ 下有很多文件。 我想将 dir1/*.png 下的所有 png 文件复制到谷歌驱动器。

然而

rclone copy dir1/*.png gdrive:dir2/

给出错误。

Usage:
  rclone copy source:path dest:path [flags]

Flags:
      --create-empty-src-dirs   Create empty source dirs on destination after copy
  -h, --help                    help for copy

Use "rclone [command] --help" for more information about a command.
Use "rclone help flags" for to see the global flags.
Use "rclone help backends" for a list of supported services.
Command copy needs 2 arguments maximum: you provided 66 non flag arguments:

有没有办法解决这个问题?

【问题讨论】:

    标签: rclone


    【解决方案1】:

    “完美”与 --include :-)

    rclone copy dir1/ gdrive:dir2/ --include "*.png"
    

    【讨论】:

    • 我会尝试并重访这里。
    【解决方案2】:

    好的,我找到了另一种解决此问题的方法。

    我使用了“排除”标志。

    这样,我排除了“directory_I_do_not_want_to_copy_under_dir1”及其所有内容。

    因此我复制了 dir1/ 下的剩余部分,包括 *.png 文件。

    不是完美的,而是一个近似的解决方案:)

    rclone copy dir1/ gdrive:dir2/ --exclude==/directory_I_do_not_want_to_copy_under_dir1/**
    

    【讨论】:

      猜你喜欢
      • 2020-08-11
      • 2018-01-10
      • 2016-06-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-01
      • 2017-04-11
      • 1970-01-01
      相关资源
      最近更新 更多