Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthecalcaholic <6317548+theCalcaholic@users.noreply.github.com>2022-09-28 16:43:28 +0300
committerthecalcaholic <6317548+theCalcaholic@users.noreply.github.com>2022-09-28 17:14:01 +0300
commit6b8501e3aa36e9ef15e3c8abad91c7868fc425ad (patch)
treee02ee63310f0925c049f4b667d17f48e11b75bb4
parent9b5fbba51776017d9b9b12de3ad93a86aa4c51c7 (diff)
run-parts.sh: Enable debug output during backups
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
-rwxr-xr-xbuild/docker/debian-ncp/run-parts.sh16
1 files changed, 11 insertions, 5 deletions
diff --git a/build/docker/debian-ncp/run-parts.sh b/build/docker/debian-ncp/run-parts.sh
index 4a01146e..0bbfc28a 100755
--- a/build/docker/debian-ncp/run-parts.sh
+++ b/build/docker/debian-ncp/run-parts.sh
@@ -19,17 +19,22 @@ then
cp -raT /data-ro /data
elif [[ -z "$NOBACKUP" ]] || [[ "$NOBACKUP" != "true" ]]
then
+ set -x
BKPDIR=/data/ncp-startup-backups/
WITH_DATA=no
COMPRESSED=yes
LIMIT=0
mkdir -p "$BKPDIR"
echo "Cleanup old startup backups..."
- BKPS="$(ls -1t "$BKPDIR"/nextcloud-bkp_*.tar.gz 2>/dev/null || true)"
- while read -r bkp
- do
- rm -f "$BKPDIR/$bkp"
- done <"$(echo "$BKPS" | tail -n +5)"
+ skip_bkp_cleanup=0
+ BKPS="$(ls -1t "$BKPDIR"/nextcloud-bkp_*.tar.gz 2>/dev/null || skip_bkp_cleanup=1)"
+ if [[ "$skip_bkp_cleanup" == 0 ]]
+ then
+ while read -r bkp
+ do
+ rm -f "$BKPDIR/$bkp"
+ done <"$(echo "$BKPS" | tail -n +5)"
+ fi
echo "Back up current instance..."
set +eE
if ncp-backup "$BKPDIR" "$WITH_DATA" "$COMPRESSED" "$LIMIT"
@@ -38,6 +43,7 @@ then
else
echo 'WARN: Backup creation failed'
fi
+ set +x
fi
# wrapper to simulate update-rc.d