summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbackomp12
1 files changed, 5 insertions, 7 deletions
diff --git a/backomp b/backomp
index 51e749a..f653621 100755
--- a/backomp
+++ b/backomp
@@ -122,16 +122,16 @@ current() {
backup() {
local dest_dir="${1}" src_path="${2}"
local retain="${3}" interval="${4}" week_start="${5}"
- local dest_path snaps keep i ki
+ local dest_path snaps keep skip i ki
mapfile -td $'\0' snaps < <(shopt -s nullglob;
printf '%s\0' "${dest_dir}/"* | awk -v 'RS=\0' -v 'ORS=\0' \
-- "${AWK_PREFILTER}")
[[ -n "${snaps}" ]] && current "${snaps[0]##*/}" "${interval}" && \
- return
-
- ((dcount++ > 0)) && echo
- echo "[${dcount}] [${retain}] ${src_path} => ${dest_dir}"
+ skip=1
+ printf '[%d] [%s] %s => %s%s\n' "$((++dcount))" "${retain}" \
+ "${src_path}" "${dest_dir}" "${skip:+ [SKIPPED]}"
+ [[ -n "${skip}" ]] && return
dest_path="${dest_dir}/$(date -u '+%Y-%m-%d-%H%M%S')"
run rsync -ac --mkpath ${snaps[0]:+"--link-dest=${snaps[0]}"} \
@@ -158,8 +158,6 @@ backup() {
run rm -r "${snaps[i]}"
fi
done
-
- printf 'kept %s\n' "${keep[@]}"
}
declare -A def_opts=(