#! /bin/bash
answer=`docker exec -i zammad_c07 /usr/bin/zammad run script/scheduler.rb status`
if [[ ${answer} =~ scheduler:[[:space:]]running[[:space:]]\[pid[[:space:]][[:digit:]]* ]]
then
echo 'scheduler is running'
else
docker exec -i zammad_c07 /usr/bin/zammad run script/scheduler.rb start
fi
Aufruf über Cron:
*/5 * * * * root /usr/local/sbin/keep_scheduler_running.sh >> /var/log/scheduler.log 2>&1