Cron updates

This commit is contained in:
Andrei Condurachi 2020-11-22 00:39:45 +02:00
parent 9467036c7b
commit 429da45420
1 changed files with 7 additions and 9 deletions

16
run.sh
View File

@ -2,20 +2,18 @@
# syslog option '-Z' was changed to '-t', change this in /etc/conf.d/syslog so that syslog (and then cron) actually starts # syslog option '-Z' was changed to '-t', change this in /etc/conf.d/syslog so that syslog (and then cron) actually starts
# https://gitlab.alpinelinux.org/alpine/aports/-/issues/9279 # https://gitlab.alpinelinux.org/alpine/aports/-/issues/9279
exec sed -i 's/SYSLOGD_OPTS="-Z"/SYSLOGD_OPTS="-t"/g' /etc/conf.d/syslog sed -i 's/SYSLOGD_OPTS="-Z"/SYSLOGD_OPTS="-t"/g' /etc/conf.d/syslog
# Start the kernel log deamon # Start the kernel log deamon
exec service klogd start service klogd start
# Start the cron deamon # Start the cron deamon
exec service crond start service crond start
# Create cron job for Grav maintenance scripts # Create cron job for Grav maintenance scripts
(crontab -l; echo "* * * * * cd /var/www/html;/usr/bin/php bin/grav scheduler 1>> /dev/null 2>&1") | crontab - (crontab -l; echo "* * * * * cd /var/www/html;/usr/bin/php bin/grav scheduler 1>> /dev/null 2>&1") | crontab -
# Cron requires that each entry in a crontab end in a newline character. If the last entry in a crontab is missing the newline, cron will consider the crontab (at least partially) broken and refuse to install it. # Cron requires that each entry in a crontab end in a newline character. If the last entry in a crontab is missing the newline, cron will consider the crontab (at least partially) broken and refuse to install it.
(crontab -l; echo "") | crontab - (crontab -l; echo "") | crontab -
# Start Apache, PHP-FPM and Cron # Start Apache
exec /usr/sbin/httpd -D FOREGROUND -f /etc/apache2/httpd.conf & service httpd start
exec /usr/sbin/php-fpm7 -F # Start PHP-FPM
service php-fpm7 start
# Make sure apache can read&right to logs and docroot
RUN chown -R apache:apache /var/log/apache2 /var/www