In theory ccollect-0.6 is ready, now let's begin testing
This commit is contained in:
parent
86960388df
commit
a35e31e86c
1 changed files with 18 additions and 23 deletions
41
ccollect.sh
41
ccollect.sh
|
@ -463,24 +463,32 @@ while [ "${i}" -lt "${no_sources}" ]; do
|
||||||
done < "${TMP}"
|
done < "${TMP}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#
|
||||||
|
# add old backup if existing
|
||||||
|
#
|
||||||
|
if [ "${last_dir}" ]; then
|
||||||
|
abs_last_dir="$(cd "${last_dir}" && pwd -P)" || _exit_err "Could not change to last dir ${last_dir}."
|
||||||
|
set -- "$@" "--link-dest=${abs_last_dir}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# set time when we really begin to backup, not when we began to remove above
|
# set time when we really begin to backup, not when we began to remove above
|
||||||
destination_date=$(${CDATE})
|
destination_date=$(${CDATE})
|
||||||
destination_dir="${c_dest}/${INTERVAL}.${destination_date}.$$"
|
destination_dir="${c_dest}/${INTERVAL}.${destination_date}.$$"
|
||||||
|
|
||||||
|
|
||||||
# give some info
|
# give some info
|
||||||
_techo "Beginning to backup, this may take some time..."
|
_techo "Beginning to backup, this may take some time..."
|
||||||
|
|
||||||
echo "Creating ${destination_dir} ..."
|
echo "Creating ${destination_dir} ..."
|
||||||
mkdir ${VVERBOSE} "${destination_dir}" || \
|
mkdir ${VVERBOSE} "${destination_dir}" || \
|
||||||
_exit_err "Creating $destination_dir failed. Skipping."
|
_exit_err "Creating ${destination_dir} failed. Skipping."
|
||||||
|
|
||||||
|
# absulte now, it's existing
|
||||||
|
abs_destination_dir="$(cd "${destination_dir}" && pwd -P)"
|
||||||
|
|
||||||
#
|
#
|
||||||
# make an absolute path, perhaps $CCOLLECT_CONF is relative!
|
# added marking in 0.6 (and remove it, if successful later)
|
||||||
#
|
|
||||||
abs_destination_dir="$(cd "$destination_dir" && pwd -P)"
|
|
||||||
|
|
||||||
#
|
|
||||||
# added mark in 0.6 (and remove it, if successful later)
|
|
||||||
#
|
#
|
||||||
touch "${abs_destination_dir}/${c_marker}"
|
touch "${abs_destination_dir}/${c_marker}"
|
||||||
|
|
||||||
|
@ -491,22 +499,9 @@ while [ "${i}" -lt "${no_sources}" ]; do
|
||||||
|
|
||||||
_techo "Transferring files..."
|
_techo "Transferring files..."
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# FIXME:useropts / rsync extra: one parameter per line!
|
|
||||||
# 0.5.3!
|
|
||||||
#
|
|
||||||
|
|
||||||
set -x
|
set -x
|
||||||
rsync "$@" "${source}" "${abs_destination_dir}"; ret=$?
|
rsync "$@" "${source}" "${abs_destination_dir}"; ret=$?
|
||||||
|
|
||||||
# abs_last_dir="$(cd "$last_dir" && pwd -P)"
|
|
||||||
# if [ -z "$abs_last_dir" ]; then
|
|
||||||
# echo "Changing to the last backup directory failed. Skipping."
|
|
||||||
# exit 1
|
|
||||||
# fi
|
|
||||||
# rsync_hardlink="--link-dest=$abs_last_dir"
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# remove marking here
|
# remove marking here
|
||||||
#
|
#
|
||||||
|
@ -534,9 +529,9 @@ while [ "${i}" -lt "${no_sources}" ]; do
|
||||||
end_s=$(date +%s)
|
end_s=$(date +%s)
|
||||||
|
|
||||||
full_seconds=$((${end_s} - ${begin_s}))
|
full_seconds=$((${end_s} - ${begin_s}))
|
||||||
hours=$(($full_seconds / 3600))
|
hours=$((${full_seconds} / 3600))
|
||||||
seconds=$(($full_seconds - ($hours * 3600)))
|
seconds=$((${full_seconds} - (${hours} * 3600)))
|
||||||
minutes=$(($seconds / 60))
|
minutes=$((${seconds} / 60))
|
||||||
seconds=$((${seconds} - (${minutes} * 60)))
|
seconds=$((${seconds} - (${minutes} * 60)))
|
||||||
|
|
||||||
_techo "Backup lasted: ${hours}:${minutes}:${seconds} (h:m:s)"
|
_techo "Backup lasted: ${hours}:${minutes}:${seconds} (h:m:s)"
|
||||||
|
|
Loading…
Reference in a new issue