如何 rclone 仅复制目录下的 .png 文件?

问题描述

我在服务器的 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:

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

解决方法

“完美”与 --include :-)

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

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

我使用了“排除”标志。

通过这种方式,我排除了“directory_I_do_not_want_to_copy_under_dir1”及其所有内容。

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

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

SELECT NAME,FAMILY_NAME,AGE,SALARY,LOCATION
FROM TABLE
WHERE AGE > 34 and SALARY > 40000