Auto renew cron python script on Site gives error on macOS

syntax error near unexpected token ‘random.random’

That error happens when a Python program is executed by bash instead of Python.


Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. https://crt.sh/?q=example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is:

I ran this command:

It produced this output:

My web server is (include version):

The operating system my web server runs on is (include version):

My hosting provider, if applicable, is:

I can login to a root shell on my machine (yes or no, or I don’t know):

I’m using a control panel to manage my site (no, or provide the name and version of the control panel):

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you’re using Certbot):

1 Like

www.milton-chocolate.nl

i ran standard auto renew cron script from certbot page for macos

i get syntax errors within python when i run the exact script on the site

apache webserver 2.4.33

macOS 10.13.6

i can login to root shell

no control panel

certbot 0.34.2

What is that script?

What are those errors?

echo “0 0,12 * * * root python -c ‘import random; import time; time.sleep(random.random() * 3600)’ && certbot renew” | sudo tee -a /etc/crontab > /dev/null

funny i tried the same copy paste i used for your reply and now the shell likes the above mentioned script without errors it just asked me for my password and executed and i m back at prompt !

thank you for your effort time and patience ! regards milton case can be closed