delete temporary directories before starting host backup
This commit is contained in:
@@ -46,6 +46,7 @@ function logecho {
|
|||||||
echo "$(pdate) $*" >> "$LOG"
|
echo "$(pdate) $*" >> "$LOG"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Loop over all hosts
|
||||||
while read -r line; do
|
while read -r line; do
|
||||||
# if line is a comment or blank, go to next line
|
# if line is a comment or blank, go to next line
|
||||||
if echo "$line" | grep -qE "^\s*(#|$)"; then continue; fi
|
if echo "$line" | grep -qE "^\s*(#|$)"; then continue; fi
|
||||||
@@ -80,6 +81,9 @@ while read -r line; do
|
|||||||
|
|
||||||
logecho "${RHOST}: Starting backups"
|
logecho "${RHOST}: Starting backups"
|
||||||
|
|
||||||
|
logecho "${RHOST}: Deleting host's temporary directories in ${TEMPDIR}"
|
||||||
|
rm -rf "${TEMPDIR:?}/${RHOST:?}/*"
|
||||||
|
|
||||||
NORDIR=$(echo "$ALLRDIR" | grep -o "|" | wc -l || true)
|
NORDIR=$(echo "$ALLRDIR" | grep -o "|" | wc -l || true)
|
||||||
NORDIR=$(($NORDIR + 1))
|
NORDIR=$(($NORDIR + 1))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user