mirror of
https://github.com/frappe/bench.git
synced 2024-11-12 00:06:36 +00:00
fix: setup cron job for renewing ssl certificate (#918)
* fix: setup cronjob for renewing ssl certificate cronjob set for 1st of every month * fix: cannonical PYPI package name updates refs: - https://pypi.org/project/python-crontab/ - https://github.com/frappe/bench/pull/918#issuecomment-589961301
This commit is contained in:
parent
d58fc11b3d
commit
92d2fbdc13
@ -83,11 +83,10 @@ def run_certbot_and_setup_ssl(site, custom_domain, bench_path, interactive=True)
|
||||
|
||||
def setup_crontab():
|
||||
job_command = '/opt/certbot-auto renew -a nginx --post-hook "systemctl reload nginx"'
|
||||
system_crontab = CronTab(tabfile='/etc/crontab', user=True)
|
||||
system_crontab = CronTab(user='root')
|
||||
if job_command not in str(system_crontab):
|
||||
job = system_crontab.new(command=job_command, comment="Renew lets-encrypt every month")
|
||||
job.every().month()
|
||||
job.enable()
|
||||
job = system_crontab.new(command=job_command, comment="Renew lets-encrypt every month")
|
||||
job.day.on(1)
|
||||
system_crontab.write()
|
||||
|
||||
|
||||
|
@ -2,7 +2,7 @@ Click==7.0
|
||||
GitPython==2.1.11
|
||||
honcho==1.0.1
|
||||
Jinja2==2.10.3
|
||||
python_crontab==2.4.0
|
||||
python-crontab==2.4.0
|
||||
requests==2.22.0
|
||||
semantic_version==2.8.2
|
||||
setuptools==40.8.0
|
||||
|
Loading…
Reference in New Issue
Block a user