Sudo bench renew-lets-encrypt requires parameter y to restart nginx how do we use this with cron?

My site is running fine in multitenancy dns, and has the correct lets Encrypt certs setup.

sudo bench renew-lets-encrypt

But when i try to create a crontab script to rerun and check for new certs every 3 months the script requires that you press y for Yes to allow nginx to stop, update certs then restart nginx

Is there a parameter than i can specify to allow :-
sudo bench renew-lets-encrypt to run non interactively? ie so when run with cron, -y is passed an as option ?

1 Like

+1. Have been looking for exactly the same to automate this in case it does not reliable work…

@Julian_Robbins @lasalesi does the below work for you?

yes | sudo bench renew-lets-encrypt

2 Likes

Thank you, @OneiricIT, yes, this works:

$ yes | sudo bench renew-lets-encrypt

runs without any interaction and can run from crontab.

1 Like

Thanks for the confirmation. I will use this too