acmesh-official / acme.sh

A pure Unix shell script implementing ACME client protocol
https://acme.sh
GNU General Public License v3.0
39.39k stars 4.97k forks source link

multiple cronjob support for multiple `--config-home` #5131

Open garryshield opened 6 months ago

garryshield commented 6 months ago

Steps to reproduce

right now --install-cronjob install a cronjob only if one not exists by check crontab -l | grep 'acme.sh --cron'. i have multiple --config-home for different purpos. i need the support for install cronjob for different --config-home like:

--install-cronjob --config-home /acme.sh/letsencrypt
--install-cronjob --config-home /acme.sh/letsencrypt_test

Debug log

/ # crontab -l
35 11 * * * "/root/.acme.sh"/acme.sh --cron --home "/root/.acme.sh" --config-home "/acme.sh" > /proc/1/fd/1 2>/proc/1/fd/2
/ # 
/ # 
/ # --install-cronjob --config-home /acme.sh/letsencrypt --debug 2
[Fri May  3 13:43:41 UTC 2024] Lets find script dir.
[Fri May  3 13:43:41 UTC 2024] _SCRIPT_='/root/.acme.sh/acme.sh'
[Fri May  3 13:43:41 UTC 2024] _script='/root/.acme.sh/acme.sh'
[Fri May  3 13:43:41 UTC 2024] _script_home='/root/.acme.sh'
[Fri May  3 13:43:41 UTC 2024] Using default home:/root/.acme.sh
[Fri May  3 13:43:41 UTC 2024] Using config home:/acme.sh/letsencrypt
[Fri May  3 13:43:41 UTC 2024] LE_WORKING_DIR='/root/.acme.sh'
https://github.com/acmesh-official/acme.sh
v3.0.8
[Fri May  3 13:43:41 UTC 2024] Running cmd: installcronjob
[Fri May  3 13:43:41 UTC 2024] Using config home:/acme.sh/letsencrypt
[Fri May  3 13:43:41 UTC 2024] default_acme_server
[Fri May  3 13:43:41 UTC 2024] ACME_DIRECTORY='https://acme.zerossl.com/v2/DV90'
[Fri May  3 13:43:41 UTC 2024] _ACME_SERVER_HOST='acme.zerossl.com'
[Fri May  3 13:43:41 UTC 2024] _ACME_SERVER_PATH='v2/DV90'
[Fri May  3 13:43:41 UTC 2024] Installing cron job
35 11 * * * "/root/.acme.sh"/acme.sh --cron --home "/root/.acme.sh" --config-home "/acme.sh" > /proc/1/fd/1 2>/proc/1/fd/2
/ # 
github-actions[bot] commented 6 months ago

Please upgrade to the latest code and try again first. Maybe it's already fixed. acme.sh --upgrade If it's still not working, please provide the log with --debug 2, otherwise, nobody can help you.