Use anacron instead of python3 sleep random for renewal on Centos/RHEL
- Dominant language
- No language data
- Stars
- 71
- Forks
- 187
- Avg merge
- 1h 45m
- Merged PRs (30d)
- 1
Description
I noticed in renewal instructions for Centos 8 the crontab entry is:
0 0,12 * * * root python3 -c 'import random; import time; time.sleep(random.random() * 3600)' && certbot renew -q
For some reason my entry was 0 0,12 * * * root python -c 'import random; import time; time.sleep(random.random() * 3600)' && certbot renew -q (python without 3) which wasn't working. I corrected it to python3 but what is the point of running python to just randomize execution time when Centos/RHEL has built in anacron for that.
Better is to just use
sudo echo $'#!/bin/sh\ncertbot renew -q' > /etc/cron.daily/certbot-renew
chmod + x /etc/cron.daily/certbot-renew
Daily tasks run time gets randomized by anacron and there is no need to invoke python just for randomizing time in 1h
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.