backup - use cp & rm instead of mv (if target is on another file system)

This commit is contained in:
2023-02-27 16:24:16 +01:00
parent 3aa2b471d6
commit 46bd695174

View File

@@ -187,7 +187,9 @@ step_3() {
exep "mv -f '${buTarget}/${buLog}0.log' '/tmp/${buLog}1.log' 2>/dev/null" exep "mv -f '${buTarget}/${buLog}0.log' '/tmp/${buLog}1.log' 2>/dev/null"
exep "'${sq_toolBin}' ${customFlags[*]} --info=stats2 ${buExcludes[*]} '${tmpSource}' '${tmpTarget}' > '/tmp/${buLog}0.log'" exep "'${sq_toolBin}' ${customFlags[*]} --info=stats2 ${buExcludes[*]} '${tmpSource}' '${tmpTarget}' > '/tmp/${buLog}0.log'"
exe mv -f /tmp/"${buLog}"*.log "${buTarget}" # mv is not the right tool moving files to a different file system
exe cp /tmp/"${buLog}"*.log "${buTarget}"
exe rm -rf /tmp/"${buLog}"*.log
exe sync exe sync
if (( remount )) ; then if (( remount )) ; then
exep "mount -o ro,remount '${buTarget}' >>/dev/null 2>&1" exep "mount -o ro,remount '${buTarget}' >>/dev/null 2>&1"