determine availability of "--fsync" option for rsync
This commit is contained in:
parent
29703761e2
commit
cddae7af12
8
.bashrc
8
.bashrc
|
@ -6,7 +6,6 @@ unalias -a
|
|||
if [[ "$(uname)" == 'Linux' ]]; then
|
||||
GNU_LS="$(command -v ls)"
|
||||
GNU_GREP="$(command -v grep)"
|
||||
RSYNC_CMD="rsync --fsync --verbose --recursive --size-only --human-readable --progress --stats --itemize-changes"
|
||||
export GNU_LS
|
||||
export GNU_GREP
|
||||
export RSYNC_CMD
|
||||
|
@ -25,7 +24,6 @@ fi
|
|||
if [[ "$(uname)" == 'Darwin' ]]; then
|
||||
GNU_LS="$(command -v gls)"
|
||||
GNU_GREP="$(command -v ggrep)"
|
||||
RSYNC_CMD="rsync --verbose --recursive --size-only --human-readable --progress --stats --itemize-changes"
|
||||
export GNU_LS
|
||||
export GNU_GREP
|
||||
export RSYNC_CMD
|
||||
|
@ -39,6 +37,12 @@ if [[ "$(uname)" == 'Darwin' ]]; then
|
|||
alias mpv="mpv --vo=libmpv"
|
||||
fi
|
||||
|
||||
if rsync --fsync 2>&1 | grep 'rsync: --fsync: unknown option' > /dev/null; then
|
||||
RSYNC_CMD="rsync --verbose --recursive --size-only --human-readable --progress --stats --itemize-changes"
|
||||
else
|
||||
RSYNC_CMD="rsync --fsync --verbose --recursive --size-only --human-readable --progress --stats --itemize-changes"
|
||||
fi
|
||||
|
||||
export PATH="$PATH:$HOME/.cargo/bin:$HOME/.local/bin"
|
||||
|
||||
alias showdiskusage="bash ${HOME}/.local/scripts/other-common-scripts/show-disk-usage.sh"
|
||||
|
|
|
@ -66,7 +66,6 @@ if status is-interactive
|
|||
set GNU_LS "$(command -v ls)"
|
||||
set GNU_GREP "$(command -v grep)"
|
||||
|
||||
set RSYNC_CMD "rsync --fsync --verbose --recursive --size-only --human-readable --progress --stats --itemize-changes"
|
||||
alias ping="ping -W 0.1 -O"
|
||||
alias mpv="mpv --geometry=60% --vo=gpu --hwdec=vaapi"
|
||||
alias mpvrpi="mpv --geometry=60% --vo=x11"
|
||||
|
@ -83,13 +82,19 @@ if status is-interactive
|
|||
if test $(uname) = "Darwin"
|
||||
set GNU_LS "$(command -v gls)"
|
||||
set GNU_GREP "$(command -v ggrep)"
|
||||
set RSYNC_CMD "rsync --verbose --recursive --size-only --human-readable --progress --stats --itemize-changes"
|
||||
|
||||
fish_add_path -p -g /usr/local/bin
|
||||
|
||||
alias ktb="sudo pkill TouchBarServer; sudo killall ControlStrip"
|
||||
end
|
||||
|
||||
# determine if '--fsync' is an available option or not
|
||||
if rsync --fsync 2>&1 | grep 'rsync: --fsync: unknown option' > /dev/null
|
||||
set RSYNC_CMD "rsync --verbose --recursive --size-only --human-readable --progress --stats --itemize-changes"
|
||||
else
|
||||
set RSYNC_CMD "rsync --fsync --verbose --recursive --size-only --human-readable --progress --stats --itemize-changes"
|
||||
end
|
||||
|
||||
# common aliases
|
||||
alias showdiskusage="bash $HOME/.local/scripts/other-common-scripts/show-disk-usage.sh"
|
||||
alias dotfiles="git --git-dir=$HOME/.dotfiles --work-tree=$HOME"
|
||||
|
|
Loading…
Reference in New Issue