add eowyn bashrc, add syncdir()

This commit is contained in:
2024-01-20 15:19:05 +01:00
parent 3d7f388fb8
commit 85e0ca1af5
2 changed files with 101 additions and 0 deletions

View File

@@ -245,6 +245,19 @@ rehash() {
alias trans="trans.sh"
alias rtrans="trans.sh -fen -tfr"
# easy directory sync (remove source trailing slash)
syncdir() {
local -a opts=(--archive --hard-links --one-file-system --itemize-changes --delete)
local src="$1" dst="$2"
case "$src" in
*[!/]*/)
src=${src%"${src##*[!/]}"};;
*[/])
src="/";;
esac
rsync "${opts[@]}" "$src" "$dst"
}
# host specific initialization
# shellcheck disable=SC1090
[ -f "$HOME/.bashrc.$USER.$(hostname)" ] && . "$HOME/.bashrc.$USER.$(hostname)"