I’ve configured a Leap 15.3 server and I want to run cert-bot daily to auto renew installed certificates. Following the SDB article: https://en.opensuse.org/SDB:Cron I have created a cron file to execute cert-bot, however I receive e-mail that there is an error with my script:
running daily cronjob scripts
SCRIPT: cert-bot exited with RETURNCODE = 127.
SCRIPT: output (stdout && stderr) follows
/etc/cron.daily/cert-bot: line 1: 01: command not found
SCRIPT: cert-bot
------- END OF OUTPUT
But based upon the SDB article I don’t see what is wrong with my cron task:
Scripts in /etc/cron.daily are exactly that - scripts. They are not crontabs. Nor does article you mention recommends creating crontabs in these directories.
I am not sure, but you should not enter a crontab entry in /etc/cron.daily (and the like), because those time indications are not needed. It is already run once a day.
A crontab entry (with the time/frequency specification) shoul go in a crontab. For root that is, as root do:
crontab -e
And while it might be true that systemd is now handling this, IMHO it will process crontabs as always for years and years to come.
Aha. Thanks. I have changed it into a script in the cron.daily directory.
Probably Systemd is the way forward, but that involves way too many lines, where as I’m now done with 2 lines and putting it in the right directory.
Looks like all the leg-work has been done for you …
From the package “README”
*# Automated renewal of certificates
*
*This package includes an optional systemd timer to handle certbot certificate renewals.
This timer is set to run daily, with a random fudge factor of a 6 hours applied.
To enable the timer based renewals:
systemctl enable --now certbot-renew.timer
The timer makes use of /etc/sysconfig/certbot to customise the behaviour.
Unless there is a plugin that automates restarts (eg the apache plugin) it is
important to configure a command to restart anything that uses the certificates
*