rsync -avi --delete --modify-window=1 --no-perms --no-o --no-g
~/Documents/Stuff/ /media/user/PC/Stuff;;
Run Code Online (Sandbox Code Playgroud)
即不从源目录复制子目录?
摘自man rsync
-a, --archive archive mode; equals -rlptgoD (no -H,-A,-X)
Run Code Online (Sandbox Code Playgroud)
-a
意味着-r
你可以:
remove `-a --no-perms --no-o --no-g ` and replace by `-ltD`
Run Code Online (Sandbox Code Playgroud)
或者
add `--no-recursive`
Run Code Online (Sandbox Code Playgroud)
--delete
增加更多的复杂性,从man rsync
--删除`
Prior to rsync 2.6.7, this option would have no effect unless --recursive was enabled.
Beginning with 2.6.7, deletions will also occur when --dirs (-d) is enabled, but only for directories whose contents are being copied.
Run Code Online (Sandbox Code Playgroud)
所以你必须使用--dirs