--no-self-upgrade ignored in cron job

Hello,

I’m trying to create a cron job inside a startup shell script to renew a certificate but the option --no-self-upgrade doesn’t work.

test.sh:

#!/bin/sh

export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin

/usr/bin/certbot-auto renew --no-self-upgrade > /var/log/cron.log

startup.sh

(crontab -l ; echo "27 0 * * * /home/ubuntu/test.sh") | crontab -

The “certbot-auto renew” command is executed but the parameter “–no-self-upgrade” is ignored. It always execute the upgrade process. If I execute “test.sh” it works as expected.

Server: Ubuntu 14.04 - hosted in AWS

Thanks in advance!

Finally I have found the problem. In test.sh I had to add:

export HOME="/root"

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