Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deoccupy root crontab #705

Merged
merged 2 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading