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:
Diffstat (limited to 'bin/ncp-update-nc')
-rwxr-xr-xbin/ncp-update-nc6
1 files changed, 6 insertions, 0 deletions
diff --git a/bin/ncp-update-nc b/bin/ncp-update-nc
index 6ac0d137..273f568a 100755
--- a/bin/ncp-update-nc
+++ b/bin/ncp-update-nc
@@ -61,6 +61,12 @@ echo "Current Nextcloud version $CURRENT"
echo "Available Nextcloud version $VER"
[[ "$NEED_UPDATE" == "true" ]] || { echo "Nothing to update"; exit 1; }
+# make sure that cron.php is not running and there are no pending jobs
+# https://github.com/nextcloud/server/issues/10949
+pgrep -cf cron.php &>/dev/null && { pkill -f cron.php; sleep 3; }
+pgrep -cf cron.php &>/dev/null && { echo "cron.php running. Abort"; exit 1; }
+mysql nextcloud <<<"UPDATE oc_jobs SET reserved_at=0;"
+
# cleanup
####################
cleanup() {