Created
December 4, 2019 05:24
-
-
Save songlairui/f40def00e2cdf381816a2d5897dc6ad3 to your computer and use it in GitHub Desktop.
测试 Rsync SRC 末尾带 / 的表现
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
## [without test folder created] create ~/test/test Then put files | |
## [with test folder created] create ~/test/test Then put files | |
rsync -avz --exclude='node_modules/' --exclude='_static/' ./test ali:test | |
## [without] create ~/test Then put files | |
## [with] create ~/test Then put files | |
rsync -avz --exclude='node_modules/' --exclude='_static/' ./test/ ali:test | |
## [without] create ~/test/test Then put files | |
## [with] create ~/test/test Then put files | |
rsync -avz --exclude='node_modules/' --exclude='_static/' ./test ali:test/ | |
## [without] create ~/test Then put files | |
## [with] create ~/test Then put files | |
rsync -avz --exclude='node_modules/' --exclude='_static/' ./test/ ali:test/ | |
# 结论: SRC 中带有 / 则取下级内容,否则取当前文件/文件夹 | |
# 预先是否建立文件夹,没有影响 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment