This is a cron script in order to execute certbot regularly. We need to install certbot in advance.
$ ./certbot-cron-script.sh
Run sudo crontab -e
, then add link the following command.
# m h dom mon dow command
28 22 15 * * /home/ubuntu/cron-script/cron-script.sh >> /home/ubuntu/cron_script.log
53 10 28 * * /home/ubuntu/cron-script/cron-script.sh >> /home/ubuntu/cron_script.log
option | description | example |
---|---|---|
WEBHOOK_URL | Slack webhook url | https://hooks.slack.com/services/xxxxxx/yyyyyyy/zzzzzzzz |
CHANNEL | Slack channel name | "#xxxx" |
SERVER_NAME | arbitrary server name | 'watched-server' |
LOG_OUTPUT_PATH | file path to output log file of cron script | /home/ubuntu/cron-script/result.log |