Unverified Commit 358ac6a1 authored by Xuehai Pan's avatar Xuehai Pan Committed by GitHub

fix(cp): add unique suffix to rsync backup directory for each user (#10170)

* fix(cp): add unique suffix to rsync backup directory for each user

* fix(cp): use `USERNAME` rather than `USER`
parent aa6e932b
......@@ -25,7 +25,7 @@ The enabled options for rsync are:
* `-hhh`: outputs numbers in human-readable format, in units of 1024 (K, M, G, T).
* `--backup-dir=/tmp/rsync`: move backup copies to "/tmp/rsync".
* `--backup-dir="/tmp/rsync-$USERNAME"`: move backup copies to "/tmp/rsync-$USERNAME".
* `-e /dev/null`: only work on local files (disable remote shells).
......
cpv() {
rsync -pogbr -hhh --backup-dir=/tmp/rsync -e /dev/null --progress "$@"
rsync -pogbr -hhh --backup-dir="/tmp/rsync-${USERNAME}" -e /dev/null --progress "$@"
}
compdef _files cpv
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment