sunetdrive/templates/application/cron.erb.sh

23 lines
486 B
Bash
Raw Permalink Normal View History

2023-02-13 09:44:56 +00:00
#!/bin/bash
echo "$(date) - Start executing cron.sh"
# These are configurable with positional args
container=${1}
if [[ -z ${container} ]]; then
container=nextcloud_app_1
fi
lock="/tmp/cron-${container}.lock"
if [[ -f ${lock} ]]; then
echo "Lockfile exists, another instance of ${0} is running"
exit 0
else
touch ${lock}
fi
/usr/bin/docker exec -u www-data ${container} php --define apc.enable_cli=1 /var/www/html/cron.php
echo "$(date) - Done executing cron.sh"
rm ${lock}