Answer the question
In order to leave comments, you need to log in
Execute command with cron?
Hey!
The question is simple, but I still ask for help. Installed the letsencrypt
certificate and you need to add its update to cron .
The manual command for renewal is:
sudo /var/www/ssl/letsencrypt/letsencrypt-auto certonly --renew-by-default
--webroot -w /var/www/ssl -d example.com && sudo service nginx reload
0 */12 * * * root /var/www/ssl/letsencrypt/letsencrypt-auto certonly
--renew-by-default --webroot -w /var/www/ssl -d example.com && service nginx reload
bin/bash: root: command not found
Answer the question
In order to leave comments, you need to log in
In which crontab file are you writing it?
In the user's crontab file (which is crontab -e), there is no column for specifying the username, this is only for /etc/cron* files.
Isn't it easier to add all this to the script?
#!/bin/bash
/var/www/ssl/letsencrypt/letsencrypt-auto certonly --renew-by-default --webroot -w /var/www/ssl -d example.com &
service nginx reload
Oh, these bicycle builders :)
https://habrahabr.ru/post/304174/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question