diff --git a/lib.sh b/lib.sh index 855bcbae68..e55e569ae3 100644 --- a/lib.sh +++ b/lib.sh @@ -461,7 +461,16 @@ done check_running_cronjobs() { while [ -n "$(pgrep -f nextcloud/cron.php)" ] do - countdown "Waiting for the Nextcloud cronjob to finish..." "30" + # Check if virus scan is running, could take ages for it to finish... + if ! pgrep -f clamd + then + # If not running, then keep waiting + countdown "Waiting for the Nextcloud cronjob to finish..." "30" + else + # If virus scan is running, then wait a bit longer, and kill it to release cron.php + countdown "Waiting for the Nextcloud cronjob and virusscan to finish..." "120" + pkill -f clamd + fi done }