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:
parent
e4dea56e49
commit
e6d89d57fc
1 changed files with 4 additions and 11 deletions
15
ccollect.sh
15
ccollect.sh
|
@ -118,10 +118,7 @@ delete_from_file()
|
|||
fi
|
||||
done < "${file}"
|
||||
_techo "Removing $@ ..."
|
||||
# pcmd rm ${VVERBOSE} -rf "$@" || _exit_err "Removing $@ failed."
|
||||
if [ ${VVERBOSE} ]; then
|
||||
echo rm "$@"
|
||||
fi
|
||||
[ "${VVERBOSE}" ] && echo rm "$@"
|
||||
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 "Creating ${destination_dir} ..."
|
||||
# pcmd mkdir ${VVERBOSE} "${destination_dir}" || \
|
||||
# _exit_err "Creating ${destination_dir} failed. Skipping."
|
||||
if [ ${VVERBOSE} ]; then
|
||||
echo mkdir "${destination_dir}"
|
||||
fi
|
||||
[ "${VVERBOSE}" ] && echo "mkdir ${destination_dir}"
|
||||
pcmd mkdir "${destination_dir}" || \
|
||||
_exit_err "Creating ${destination_dir} failed. Skipping."
|
||||
|
||||
|
@ -524,7 +517,7 @@ while [ "${i}" -lt "${no_sources}" ]; do
|
|||
# the rsync part
|
||||
#
|
||||
_techo "Transferring files..."
|
||||
rsync $@ "${source}" "${destination_full}"; ret=$?
|
||||
rsync "$@" "${source}" "${destination_full}"; ret=$?
|
||||
_techo "Finished backup (rsync return code: $ret)."
|
||||
|
||||
#
|
||||
|
@ -562,7 +555,7 @@ while [ "${i}" -lt "${no_sources}" ]; do
|
|||
#
|
||||
if [ -x "${c_post_exec}" ]; then
|
||||
_techo "Executing ${c_post_exec} ..."
|
||||
"${c_post_exec}" "${destination_full}"; ret=$?
|
||||
"${c_post_exec}"; ret=$?
|
||||
_techo "Finished ${c_post_exec}."
|
||||
|
||||
if [ "${ret}" -ne 0 ]; then
|
||||
|
|
Loading…
Reference in a new issue