rsync [options] [source] [destination]
--Behavior differs depending on the presence or absence of the trailing slash in the copy source --It doesn't matter if the copy destination has a trailing slash.
$ rsync -av /src/a /bkup
$ rsync -av /src/a /bkup/
#The above has the same meaning
--The main body of directory a is copied directly under / bkup. --If you put / at the end of the copy source, the contents of directory a will be placed directly under / bkup, so there will be no a folder in the copy destination.
$ rsync -av /src/a/ /bkup/a
$ rsync -av /src/a/ /bkup/a/
#The above has the same meaning
--The contents of directory a are copied directly under / bkup / a. --If you delete / at the end of the copy source, the directory a itself will be placed directly under / bkup / a, resulting in / bkup / a / a.
https://qiita.com/QUANON/items/2953c52df7f65f2ecee5 http://code.lioon.net/shell/how-to-set-paths-for-rsync.html https://www.itmedia.co.jp/enterprise/articles/0804/21/news013.html
https://www.kabegiwablog.com/entry/2018/06/21/100000
This article says the exact opposite. ..
Recommended Posts