添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
孤独的橙子  ·  flink sql ...·  1 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

Not entirely true... you CAN rename files enroute with rsync, but only if you rsync one file at a time, and set the --no-R --no-implied-dirs options, then explicitly set the destination name in the destination path.

But at that point, you may just want to use some other tool.

This, for example, would work:

rsync --no-R --no-implied-dirs
1.2.3.4::module/$FILENAME
/$PATH/$TOFILE/$NEWFILENAME
                Actually, rsync is useful for a single file in some circumstances.  If the file is large, and has either only had minor changes, or has only been appended to, it's a good fit.
– Royce Williams
                Jun 8, 2015 at 14:28
                According to man page, --no-implied-dirs only affects how --relative works. And --relative is the same as -R. But you use --no-R, which makes me wonders what effect  --no-implied-dirs is supposed to have in that case?
– Mecki
                Oct 12, 2017 at 19:12

There is no way to arbitrarily rename files with rsync. All rsync can do is move files to a different directory.

You must use a second tool either on the sending or receiving side to rename the files.

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.