If they must be on the same line, e.g. for cron, you can use the && construct (or a semicolon if you want the logs to rotate whether or not certbot successfully renews your certs) to run them on the same line.
Your cron job isn’t running because Ubuntu uses systemd as its init system. (Take a peek at the comments in /etc/cron.d/certbot.) Also, there isn’t a root command available for Ubuntu (did a quick search on the Ubuntu Packages site and I can’t see anything that provides a root executable).
You’ll have to manually create the cron job yourself by using sudo cron and entering in something like:
If it's easier, I wrote a little bit about that here.
Quoted below:
The above will run the update command every 12 hours (randomized between +1 and +30 minutes to save the servers a little headache) and update if needed. If there's an error, the logs won't rotate, and if the renewal succeeds, logs will be rotated.
marco@pc01:/etc/nginx/conf.d$ sudo nginx -t && sudo service nginx reload
nginx: [warn] the “ssl” directive is deprecated, use the “listen … ssl” directive instead in /etc/nginx/conf.d/default.conf:5
nginx: [emerg] invalid parameter “server” in /etc/nginx/conf.d/default.conf:30
nginx: configuration file /etc/nginx/nginx.conf test failed
Since you’re pushing traffic to the other server, headers never get sent and your proxy is never used. I don’t think it’ll actually cause any problems as-is, but it just looks cleaner and it’s easier to debug if things are as simple as possible. You don’t need to do that if you don’t want to.
@JuergenAuer
Unfortunately something again has to be fixed:
marco@pc01:/etc/nginx/conf.d$ sudo certbot --nginx -d ggc.world -d
www.ggc.world
[sudo] password for marco:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
The requested nginx plugin does not appear to be installed
marco@pc01:/etc/nginx/conf.d$
marco@pc01:/etc/cron.d$ systemctl enable certbot.timer
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-unit-files ===
Authentication is required to manage system service or unit files.
Authenticating as: marco
Password:
==== AUTHENTICATION COMPLETE ===
==== AUTHENTICATING FOR org.freedesktop.systemd1.reload-daemon ===
Authentication is required to reload the systemd state.
Authenticating as: marco
Password:
==== AUTHENTICATION COMPLETE ===
marco@pc01:/etc/cron.d$ systemctl start certbot.timer
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to start 'certbot.timer'.
Authenticating as: marco
Password:
==== AUTHENTICATION COMPLETE ===
marco@pc01:/etc/cron.d$ sudo systemctl list-timers
[sudo] password for marco:
NEXT LEFT LAST PASSED UNIT
ACTIVATES
Sat 2019-07-20 02:53:15 UTC 8h left Fri 2019-07-19 14:14:58 UTC 3h 40min
ago motd-news.timer motd-news.service
Sat 2019-07-20 05:30:07 UTC 11h left Fri 2019-07-19 13:26:36 UTC 4h 28min
ago certbot.timer certbot.service
Sat 2019-07-20 05:33:22 UTC 11h left Fri 2019-07-19 13:26:36 UTC 4h 28min
ago apt-daily.timer apt-daily.service
Sat 2019-07-20 06:34:30 UTC 12h left Fri 2019-07-19 13:26:36 UTC 4h 28min
ago apt-daily-upgrade.timer apt-daily-upgrade.service
Sat 2019-07-20 13:41:58 UTC 19h left Fri 2019-07-19 13:41:58 UTC 4h 13min
ago systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
Mon 2019-07-22 00:00:00 UTC 2 days left Mon 2019-07-15 06:23:55 UTC 4
days ago fstrim.timer fstrim.service
n/a n/a Fri 2019-07-19 13:28:50 UTC 4h 26min ago
ureadahead-stop.timer ureadahead-stop.service
7 timers listed.
Pass --all to see loaded but inactive timers, too.
As far as I understand the renewal process should now restart properly… am I right or is there something more to do and / or to fix?
And another thing I do not understand is that in this file