Cronjob renew debian


#1

Hello my friends,

at the first: Im German and my English is not so well, sorry for that.

I try to set up an cronjob for the cert and i try to write and script and save it into
/etc/cron.monthly

my script:
# Create Cronjob with mailserver
cat > /etc/cron.monthly/cert.sh <<END
cd ~/sources/letsencrypt
service nginx stop
./letsencrypt-auto --agree-tos --renew-by-default --non-interactive --standalone --email ${SSLMAIL} --rsa-key-size ${RSA_KEY_SIZE} -d ${MYDOMAIN} -d www.${MYDOMAIN} -d mail.${MYDOMAIN} -d autodiscover.${MYDOMAIN} -d autoconfig.${MYDOMAIN} -d dav.${MYDOMAIN} certonly
service nginx start
END

but if i run this script manuell i have to set up “2” for “Standalone” How i can insert it into my script?


#2

Hi @BoBBer446, do you really have a literal underscore character (_) following the word certonly in your script? (It doesn’t belong there.)


#3

Ah, no there is no underline after this command
I dont know why here the underline is shown, i think that was the editor :smiley:

# Create Cronjob with mailserver
cat > /etc/cron.monthly/cert.sh <<END
cd ~/sources/letsencrypt
service nginx stop
./letsencrypt-auto --agree-tos --renew-by-default --non-interactive --standalone --email ${SSLMAIL} --rsa-key-size ${RSAKEY_SIZE} -d ${MYDOMAIN} -d www.${MYDOMAIN} -d mail.${MYDOMAIN} -d autodiscover.${MYDOMAIN} -d autoconfig.${MYDOMAIN} -d dav.${MYDOMAIN} certonly
service nginx start
END

Thats my script but i want that non interactive but he hasts for webroot or Standalone. I need “2” for standalone.

somethink is wrong


#4

I don’t understand

Why do you want 2 ? do you want the same for a second domain ?


#5

i cant explain, but i try.

I install the cert:

git clone https://github.com/letsencrypt/letsencrypt ~/sources/letsencrypt -q
cd ~/sources/letsencrypt
./letsencrypt-auto --agree-tos --renew-by-default --non-interactive --standalone --email ${SSLMAIL} --rsa-key-size ${RSA_KEY_SIZE} -d ${MYDOMAIN} -d www.${MYDOMAIN} -d mail.${MYDOMAIN} -d autodiscover.${MYDOMAIN} -d autoconfig.${MYDOMAIN} -d dav.${MYDOMAIN} certonly

After 90 Days i want to renew the cert. I log me in into my server.
I write:

cd ~/sources/letsencrypt
service nginx stop
./letsencrypt-auto --agree-tos --renew-by-default --email deine@email.de --rsa-key-size 4096 -d deinedomain.tld -d www.deinedomain.tld -d mail.deinedomain.tld -d autodiscover.deinedomain.tld -d autoconfig.deinedomain.tld -d dav.deinedomain.tld certonly
service nginx start

There comes an Windows there i have to choose between 1 (webroot) and 2 Standalone.
On My Config, i need choose “2”.

How i can do this automatically?

I’m terribly sorry for my bad english


#6

include the “–non-interactive --standalone” on the renew.


#7

Okay, i try:

./letsencrypt-auto --agree-tos --renew-by-default --non-interactive --standalone --email ${SSLMAIL} --rsa-key-size ${RSA_KEY_SIZE} -d ${MYDOMAIN} -d www.${MYDOMAIN} -d mail.${MYDOMAIN} -d autodiscover.${MYDOMAIN} -d autoconfig.${MYDOMAIN} -d dav.${MYDOMAIN} certonly

Thank you for helping me


#8

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.