aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO2
-rwxr-xr-xrsync-backup.sh16
2 files changed, 11 insertions, 7 deletions
diff --git a/TODO b/TODO
index 5213c3f..b62b497 100644
--- a/TODO
+++ b/TODO
@@ -14,6 +14,8 @@
- Allow resuming of backups.
`- See rsync's `--ignore-existing' flag
- Shell completion of configured backup paths.
+- Use `local'.
+- Better error handling on failure (of rsync).
# -- PROBLEMS -- #
- rsync bug: https://bugzilla.samba.org/show_bug.cgi?id=13445
diff --git a/rsync-backup.sh b/rsync-backup.sh
index a03da9b..4f33be4 100755
--- a/rsync-backup.sh
+++ b/rsync-backup.sh
@@ -28,7 +28,7 @@ typeset -A bakpath
typeset filter_file_all # Applied after specific filter.
typeset -A filter_file
-# Default arguments for rsync (-rptoglHS, --timeout, --info).
+# Default arguments for rsync (-rptogAXlHS, --timeout, --info).
rsync_args=(
--recursive
--perms --times --owner --group
@@ -68,7 +68,7 @@ typeset -i i n
# --progress
# possibly: --devices --specials
# --max-size=SIZE-OF-FILE
-# --one-file-system
+# --one-file-system
# --log-file=FILE --log-file-format=FORMAT
# --human-readable
# unlikely: --omit-{dir,link}-times --update (!--inplace) --delete
@@ -277,12 +277,14 @@ function refresh_symlinks
done
dirs[$n]="$bakdate" # Set last dir on current.
- max_n_zeros=$((${#n} - 1))
- i=1
- while [ $i -le $max_n_zeros ]
+
+ max_digits=${#n}
+ zeros[max_digits]=''
+ i=$max_digits-1
+ while [ $i -ge 1 ]
do
- zeros[i]=$(printf '%.s0' {$i..$max_n_zeros})
- i+=1
+ zeros[i]=${zeros[i+1]}0
+ i+=-1
done
i=0