run-parts.sh: Create backup before shutting down services

Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
This commit is contained in:
thecalcaholic 2022-09-28 22:02:28 +02:00
parent 270fc64d0c
commit f3292624eb
No known key found for this signature in database
GPG Key ID: 3510056072886A8F
2 changed files with 7 additions and 5 deletions

View File

@ -129,8 +129,7 @@ jobs:
echo 'CONTAINER:: =========='
docker logs -f nextcloudpi |& awk '{ print "CONTAINER::" $0 }' &
docker exec nextcloudpi bash -c 'tail -f /var/log/ncp.log' |& awk '{ print "NCP::" $0 }' &
cmd=(python activation_tests.py --no-gui localhost 8443 4443)
[[ "${ARCH?}" == "x86" ]] || cmd+=(--timeout 300)
[[ "${ARCH?}" == "x86" ]] || sleep 30
sleep 20
@ -239,6 +238,7 @@ jobs:
echo ":: System Tests (attempt $attempt/3) ::"
python system_tests.py --no-ping --non-interactive || {
echo "CI:: System test (attempt $attempt) failed!"
sleep 5
continue
}
success=true
@ -257,6 +257,7 @@ jobs:
python nextcloud_tests.py --no-gui localhost 8443 4443 || {
tail -n 20 geckodriver.log >&2 || true
echo "CI:: Nextcloud test (attempt $attempt/3) failed!"
sleep 5
continue
}
success=true

View File

@ -2,9 +2,6 @@
cleanup()
{
for file in $( ls -1rv /etc/services-enabled.d ); do
/etc/services-enabled.d/"$file" stop "$1"
done
if [[ -z "$NOBACKUP" ]] || [[ "$NOBACKUP" != "true" ]]
then
BKPDIR=/data/docker-shutdown-backups/
@ -31,6 +28,10 @@ cleanup()
echo 'WARN: Backup creation failed'
fi
fi
for file in $( ls -1rv /etc/services-enabled.d ); do
/etc/services-enabled.d/"$file" stop "$1"
done
exit
}