aboutsummaryrefslogtreecommitdiffstats
path: root/.config/zsh
diff options
context:
space:
mode:
authorDavid Runge <dave@sleepmap.de>2022-12-09 23:15:04 +0100
committerDavid Runge <dave@sleepmap.de>2022-12-09 23:15:04 +0100
commitfbfc925bbb9bee0b99ff7a6fb736c76e9906bd66 (patch)
tree7b2c046dd146ca75d05ebd451de131a4e37dcc32 /.config/zsh
parent6e0b6baba58611e70d993755289573e80cb26460 (diff)
downloaddotfiles-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.
Diffstat (limited to '.config/zsh')
-rw-r--r--.config/zsh/includes/functions.zsh79
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