diff --git a/ccollect.sh b/ccollect.sh index e797c0c..6959fa0 100755 --- a/ccollect.sh +++ b/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