如何在用rsync覆盖文件之前备份文件
How to backup files before overwriting them with rsync
我正在使用 rsync copy/deploy 仅 new/modified 文件从开发环境到测试环境。
如何在覆盖文件之前备份文件(在测试环境中)?
只是那些将被覆盖的。
干杯
马特奥
我认为你应该使用 rsync
的 --backup
选项。使用 --backup-dir
或 --suffix
也很有用。
-b, --backup
With this option, preexisting destination files are renamed as
each file is transferred or deleted. You can control where the
backup file goes and what (if any) suffix gets appended using
the --backup-dir and --suffix options
我正在使用 rsync copy/deploy 仅 new/modified 文件从开发环境到测试环境。 如何在覆盖文件之前备份文件(在测试环境中)? 只是那些将被覆盖的。
干杯 马特奥
我认为你应该使用 rsync
的 --backup
选项。使用 --backup-dir
或 --suffix
也很有用。
-b, --backup
With this option, preexisting destination files are renamed as
each file is transferred or deleted. You can control where the
backup file goes and what (if any) suffix gets appended using
the --backup-dir and --suffix options