diff options
author | David Runge <dave@sleepmap.de> | 2022-12-09 23:15:04 +0100 |
---|---|---|
committer | David Runge <dave@sleepmap.de> | 2022-12-09 23:15:04 +0100 |
commit | fbfc925bbb9bee0b99ff7a6fb736c76e9906bd66 (patch) | |
tree | 7b2c046dd146ca75d05ebd451de131a4e37dcc32 | |
parent | 6e0b6baba58611e70d993755289573e80cb26460 (diff) | |
download | dotfiles-fbfc925bbb9bee0b99ff7a6fb736c76e9906bd66.tar.gz dotfiles-fbfc925bbb9bee0b99ff7a6fb736c76e9906bd66.tar.bz2 dotfiles-fbfc925bbb9bee0b99ff7a6fb736c76e9906bd66.tar.xz dotfiles-fbfc925bbb9bee0b99ff7a6fb736c76e9906bd66.zip |
Make rsync functions more readable
.config/zsh/includes/functions.zsh:
Change backupinfo() and backupfolder() to become more readable by using
a local array for all options and using long names.
-rw-r--r-- | .config/zsh/includes/functions.zsh | 79 |
1 files changed, 48 insertions, 31 deletions
diff --git a/.config/zsh/includes/functions.zsh b/.config/zsh/includes/functions.zsh index afe4915..9a9ca50 100644 --- a/.config/zsh/includes/functions.zsh +++ b/.config/zsh/includes/functions.zsh @@ -268,40 +268,57 @@ lstar() { ## RSYNC backupinfo() { - rsync\ - -r\ - -n\ - -t\ - -p\ - -o\ - -h\ - -g\ - -v\ - --progress\ - --delete\ - --ignore-existing\ - --size-only\ - -s\ - --exclude 'lost+found'\ - --exclude '.Trash-1000'\ - --exclude '$RECYCLEBIN'\ - --exclude 'System Volume Information'\ - --exclude '.thumbs'\ - $1 $2 - echo "backupfolder path/to/folder/ /path/to/other/folder" + local options=( + --delete + --dry-run + --exclude 'System Volume Information' + --exclude 'lost+found' + --exclude '.DS_Store' + --exclude '.Trash-*' + --exclude '.snapshots' + --exclude '.thumbs' + --exclude '$RECYCLEBIN' + --group + --human-readable + --ignore-existing + --owner + --perms + --progress + --recursive + --secluded-args + --size-only + --times + --verbose + ) + + rsync "${options[@]}" "$1" "$2" + echo "NOTE: path/to/folder/ /path/to/other/folder" } backupfolder() { - rsync \ - -r\ - -t\ - -p\ - -o\ - -h\ - -g\ - -v\ - --progress\ - --delete --ignore-existing --size-only -s --exclude 'lost+found' --exclude '.Trash-1000' --exclude '$RECYCLEBIN' --exclude 'System Volume Information' --exclude '.thumbs' $1 $2 + local options=( + --delete + --exclude 'System Volume Information' + --exclude 'lost+found' + --exclude '.DS_Store' + --exclude '.Trash-*' + --exclude '.snapshots' + --exclude '.thumbs' + --exclude '$RECYCLEBIN' + --group + --human-readable + --ignore-existing + --owner + --perms + --progress + --recursive + --secluded-args + --size-only + --times + --verbose + ) + + rsync "${options[@]}" "$1" "$2" } # journalctl |