Separate script for cron
This commit is contained in:
22
doc/usage.md
22
doc/usage.md
@@ -77,10 +77,26 @@ the script will be quiet to be cron friendly. If an error occurs, the script wil
|
|||||||
You should execute `acme-client auto` as a daily cron. It's recommended to setup e-mail notifications for all output of
|
You should execute `acme-client auto` as a daily cron. It's recommended to setup e-mail notifications for all output of
|
||||||
that script.
|
that script.
|
||||||
|
|
||||||
```sh
|
Create a new script, e.g. in `/usr/local/bin/acme-renew`. The `PATH` might need to be modified to suit your system.
|
||||||
0 0 * * * /usr/local/sbin/acme-client auto; RC=$?; if [ $RC = 4 ] || [ $RC = 5 ]; then /usr/sbin/service nginx reload; fi
|
|
||||||
|
```bash
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
export PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
|
||||||
|
|
||||||
|
acme-client auto
|
||||||
|
|
||||||
|
RC=$?
|
||||||
|
|
||||||
|
if [ $RC = 4 ] || [ $RC = 5 ]; then
|
||||||
|
service nginx reload
|
||||||
|
fi
|
||||||
|
```
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# Cron Job Configuration
|
||||||
|
0 0 * * * /usr/local/bin/acme-renew
|
||||||
```
|
```
|
||||||
The path to `acme-client` should be modified to suit your system. The full path should be used as the system path may not be set up in your cron environment.
|
|
||||||
|
|
||||||
| Exit Code | Description |
|
| Exit Code | Description |
|
||||||
|-----------|-------------|
|
|-----------|-------------|
|
||||||
|
|||||||
Reference in New Issue
Block a user