diff options
Diffstat (limited to 'rsync-backup.sh')
-rwxr-xr-x | rsync-backup.sh | 16 |
1 files changed, 9 insertions, 7 deletions
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 |