rclone touch

rclone touch

Create new file or change file modification time.

Synopsis

Set the modification time on file(s) as specified by remote:path to have the current time.

If remote:path does not exist then a zero sized file will be created, unless --no-create or --recursive is provided.

If --recursive is used then recursively sets the modification time on all existing files that is found under the path. Filters are supported, and you can test with the --dry-run or the --interactive/-i flag.

If --timestamp is used then sets the modification time to that time instead of the current time. Times may be specified as one of:

  • ‘YYMMDD’ - 例如 17.10.30
  • ‘YYYY-MM-DDTHH:MM:SS’ - 例如 2006-01-02T15:04:05
  • ‘YYYY-MM-DDTHH:MM:SS.SSS’ - 例如 2006-01-02T15:04:05.123456789

请注意,--timestamp 的值是 UTC 时间。如果你想要使用本地时间,请添加 --localtime 参数。

rclone touch remote:path [flags]

Options

  -h, --help               help for touch
      --localtime          Use localtime for timestamp, not UTC
  -C, --no-create          Do not create the file if it does not exist (implied with --recursive)
  -R, --recursive          Recursively touch all files
  -t, --timestamp string   Use specified time instead of the current time of day

接下来将介绍与其他命令共享的选项。 有关此处未列出的全局选项,请参阅 全局标志页面

Important Options

对大多数命令有用的重要标记

  -n, --dry-run         Do a trial run with no permanent changes
  -i, --interactive     Enable interactive mode
  -v, --verbose count   Print lots more stuff (repeat for more)

Filter Options

Flags for filtering directory listings

      --delete-excluded                     删除目标端中被排除在同步之外的文件
      --exclude stringArray                 排除符合指定模式的文件
      --exclude-from stringArray            从文件中读取要排除的文件模式(使用 - 从标准输入读取)
      --exclude-if-present stringArray      如果指定文件名存在,则排除该目录
      --files-from stringArray              从文件中读取源文件名列表(使用 - 从标准输入读取)
      --files-from-raw stringArray          从文件中读取源文件名列表,不对行进行任何处理(使用 - 从标准输入读取)
  -f, --filter stringArray                  添加文件过滤规则
      --filter-from stringArray             从文件中读取文件过滤模式(使用 - 从标准输入读取)
      --ignore-case                         在过滤时忽略大小写(大小写不敏感)
      --include stringArray                 包含符合指定模式的文件
      --include-from stringArray            从文件中读取要包含的文件模式(使用 - 从标准输入读取)
      --max-age Duration                    仅传输比指定时间(以秒或后缀 ms|s|m|h|d|w|M|y 表示)更新的文件(默认关闭)
      --max-depth int                       如果设置,则将递归深度限制为此值(默认 -1)
      --max-size SizeSuffix                 仅传输小于指定大小(以 KiB 或后缀 B|K|M|G|T|P 表示)的文件(默认关闭)
      --metadata-exclude stringArray        排除符合指定模式的元数据
      --metadata-exclude-from stringArray   从文件中读取要排除的元数据模式(使用 - 从标准输入读取)
      --metadata-filter stringArray         添加元数据过滤规则
      --metadata-filter-from stringArray    从文件中读取元数据过滤模式(使用 - 从标准输入读取)
      --metadata-include stringArray        包含符合指定模式的元数据
      --metadata-include-from stringArray   从文件中读取要包含的元数据模式(使用 - 从标准输入读取)
      --min-age Duration                    仅传输比指定时间(以秒或后缀 ms|s|m|h|d|w|M|y 表示)更旧的文件(默认关闭)
      --min-size SizeSuffix                 仅传输大于指定大小(以 KiB 或后缀 B|K|M|G|T|P 表示)的文件(默认关闭)

Listing Options

Flags for listing directories

      --default-time Time   如果文件和目录的 modtime 未知,则显示时间(默认为 2000-01-01T00:00:00Z)
      --fast-list           如果有递归列表,则使用递归列表;使用的内存较多,但事务较少

参见

  • rclone - 显示 rclone 命令、标志和后端帮助。