Fix Patricks patch: remove comments, remove if..then, add quotes for $@, do not add destination_full for post_exec

Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
This commit is contained in:
Nico Schottelius 2009-10-31 10:01:11 +01:00
parent e4dea56e49
commit e6d89d57fc

View file

@ -118,10 +118,7 @@ delete_from_file()
fi fi
done < "${file}" done < "${file}"
_techo "Removing $@ ..." _techo "Removing $@ ..."
# pcmd rm ${VVERBOSE} -rf "$@" || _exit_err "Removing $@ failed." [ "${VVERBOSE}" ] && echo rm "$@"
if [ ${VVERBOSE} ]; then
echo rm "$@"
fi
pcmd rm -rf "$@" || _exit_err "Removing $@ failed." pcmd rm -rf "$@" || _exit_err "Removing $@ failed."
} }
@ -507,11 +504,7 @@ while [ "${i}" -lt "${no_sources}" ]; do
_techo "Beginning to backup, this may take some time..." _techo "Beginning to backup, this may take some time..."
_techo "Creating ${destination_dir} ..." _techo "Creating ${destination_dir} ..."
# pcmd mkdir ${VVERBOSE} "${destination_dir}" || \ [ "${VVERBOSE}" ] && echo "mkdir ${destination_dir}"
# _exit_err "Creating ${destination_dir} failed. Skipping."
if [ ${VVERBOSE} ]; then
echo mkdir "${destination_dir}"
fi
pcmd mkdir "${destination_dir}" || \ pcmd mkdir "${destination_dir}" || \
_exit_err "Creating ${destination_dir} failed. Skipping." _exit_err "Creating ${destination_dir} failed. Skipping."
@ -524,7 +517,7 @@ while [ "${i}" -lt "${no_sources}" ]; do
# the rsync part # the rsync part
# #
_techo "Transferring files..." _techo "Transferring files..."
rsync $@ "${source}" "${destination_full}"; ret=$? rsync "$@" "${source}" "${destination_full}"; ret=$?
_techo "Finished backup (rsync return code: $ret)." _techo "Finished backup (rsync return code: $ret)."
# #
@ -562,7 +555,7 @@ while [ "${i}" -lt "${no_sources}" ]; do
# #
if [ -x "${c_post_exec}" ]; then if [ -x "${c_post_exec}" ]; then
_techo "Executing ${c_post_exec} ..." _techo "Executing ${c_post_exec} ..."
"${c_post_exec}" "${destination_full}"; ret=$? "${c_post_exec}"; ret=$?
_techo "Finished ${c_post_exec}." _techo "Finished ${c_post_exec}."
if [ "${ret}" -ne 0 ]; then if [ "${ret}" -ne 0 ]; then