Skip to content

Commit

Permalink
Merge pull request #705 from andrey-utkin/deoccupy-root-crontab
Browse files Browse the repository at this point in the history
Deoccupy root crontab
  • Loading branch information
andrey-utkin authored Oct 21, 2024
2 parents d8b779e + 43b4320 commit 2a1bb9c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
17 changes: 14 additions & 3 deletions debian/bluecherry.cron
Original file line number Diff line number Diff line change
@@ -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
7 changes: 5 additions & 2 deletions misc/postinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2a1bb9c

Please sign in to comment.