diff --git a/debian/bluecherry.cron b/debian/bluecherry.cron index 6fef1ea1..ed3b1866 100644 --- a/debian/bluecherry.cron +++ b/debian/bluecherry.cron @@ -1,3 +1,14 @@ -# m h dom mon dow user command -0 0 * * * bluecherry /usr/share/bluecherry/backup_db.sh -30 0 * * * bluecherry curl -k https://localhost:7001/subdomainprovidercron +# This file is a part of bluecherry package. + +# .---------------- minute (0 - 59) +# | .------------- hour (0 - 23) +# | | .---------- day of month (1 - 31) +# | | | .------- month (1 - 12) OR jan,feb,mar,apr ... +# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat +# | | | | | +# * * * * * user-name command to be executed +* * */5 * * root certbot renew --config-dir=/usr/share/bluecherry/nginx-includes/letsencrypt/ &> /var/log/bluecherry-letsencrypt.log +0 0 * * * bluecherry /usr/share/bluecherry/backup_db.sh +30 0 * * * bluecherry curl -k https://localhost:7001/subdomainprovidercron + +# vim: syntax=crontab diff --git a/misc/postinstall.sh b/misc/postinstall.sh index d1781db0..c3002254 100755 --- a/misc/postinstall.sh +++ b/misc/postinstall.sh @@ -158,6 +158,7 @@ function stop_apache # 1 - rpm install, 2 - rpm upgrade case "$1" in configure|reconfigure|1|2) + PREV_INSTALLED_VERSION=$2 if [[ $IN_DEB ]] then ucfr bluecherry /etc/bluecherry.conf @@ -446,8 +447,10 @@ case "$1" in install_certbot - # Install crontabs for subdomain renewal and SSL renewal using certbot - crontab -l 2>/dev/null || true; printf "* * */5 * * certbot renew --config-dir=/usr/share/bluecherry/nginx-includes/letsencrypt/ >/dev/null 2>&1\n*/5 * * * * curl -k https://localhost:7001/subdomainprovidercron >/dev/null 2>&1\n" | crontab - + # Clean root's crontab from entries which we previously put there + # FIXME one-time upgrade procedure would be nice. + # we have a nice way but use it only for mysql upgrades. + crontab -l 2>/dev/null | grep -v 'bluecherry\|subdomainprovidercron' | crontab - nginx -t 2>/dev/null > /dev/null