From 29d9742bd7a7b634d5bb9b06e173007cf7466c24 Mon Sep 17 00:00:00 2001 From: Einhard Leichtfuß Date: Mon, 8 Oct 2018 20:18:00 +0200 Subject: Apply generic filter after specific filter Also: - Remove `-vv'. - Add progress bar. --- TODO | 2 ++ rsync-backup.sh | 15 ++++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/TODO b/TODO index 25a0285..5213c3f 100644 --- a/TODO +++ b/TODO @@ -12,9 +12,11 @@ - Delete 'too new' symlinks in by_number. - Per dirpath rsync_args. - Allow resuming of backups. + `- See rsync's `--ignore-existing' flag - Shell completion of configured backup paths. # -- PROBLEMS -- # +- rsync bug: https://bugzilla.samba.org/show_bug.cgi?id=13445 - Permissions. `- Suppress error output by 2>/dev/null. `- Save errors in a var by 'var="`cmd 2>&1`"'. diff --git a/rsync-backup.sh b/rsync-backup.sh index ae094ea..8f278c5 100755 --- a/rsync-backup.sh +++ b/rsync-backup.sh @@ -25,10 +25,10 @@ RSYNC=rsync typeset -a rsync_args typeset -a rsync_inc_args typeset -A bakpath -typeset filter_file_all +typeset filter_file_all # Applied after specific filter. typeset -A filter_file -# Default arguments for rsync. +# Default arguments for rsync (-rptoglHS, --timeout, --info). rsync_args=( --recursive --perms --times --owner --group @@ -37,7 +37,8 @@ rsync_args=( --hard-links --sparse --timeout=60 - -vv + #-vv + --info=progress2 ) # Supplemental arguments for rsync; only used when an actual incremental @@ -122,14 +123,14 @@ function get_args fi filter_args=() - if test -v filter_file_all -a -f "$filter_file_all" - then - filter_args=("--filter=merge ${filter_file_all}") - fi if test -v filter_file[$dirpath] && test -f "${filter_file[$dirpath]}" then filter_args+=("--filter=merge ${filter_file[$dirpath]}") fi + if test -v filter_file_all -a -f "$filter_file_all" + then + filter_args+=("--filter=merge ${filter_file_all}") + fi } -- cgit v1.2.3