Originally created by @dulemis on GitHub (Oct 3, 2017).
Having an issue with crontab. On the command line everything works, but in crontab the ouput of the same command is (sent to file):
INFO: Using main config file /jffs/LetsEncrypt/config
Nothing more. When running it on the command line everything works, I'm amanually specifying the configuration path with --config. Any idea what could be causing this?
Originally created by @dulemis on GitHub (Oct 3, 2017).
Having an issue with crontab. On the command line everything works, but in crontab the ouput of the same command is (sent to file):
# INFO: Using main config file /jffs/LetsEncrypt/config
Nothing more. When running it on the command line everything works, I'm amanually specifying the configuration path with --config. Any idea what could be causing this?
Are you running it directly from the crontab or are you wrapping it in a script?
Personally I use a simple shell script that first cd's to the directory containing dehydrated and the config file and then have the script call ./dehydrated -c
@jobe1986 commented on GitHub (Oct 3, 2017):
Are you running it directly from the crontab or are you wrapping it in a script?
Personally I use a simple shell script that first cd's to the directory containing dehydrated and the config file and then have the script call ./dehydrated -c
Just a wild guess: A common pitfall using crontab is the $PATH environmental variable. On lots of systems an application started from a shell (with a user logged in) uses a different $PATH variable than the same application started via crontab.
So make sure to have all tools required by dehydrated in the $PATH that is used by crontab.
@Aikhjarto commented on GitHub (Oct 4, 2017):
Just a wild guess: A common pitfall using crontab is the $PATH environmental variable. On lots of systems an application started from a shell (with a user logged in) uses a different $PATH variable than the same application started via crontab.
So make sure to have all tools required by dehydrated in the $PATH that is used by crontab.
I've run a test script with cron outputting the path, and compared it with the path with the same user logged on to the shell. Do you see any differences that could be causing the problem?
@dulemis commented on GitHub (Oct 4, 2017):
I've run a test script with cron outputting the path, and compared it with the path with the same user logged on to the shell. Do you see any differences that could be causing the problem?
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/opt/sbin:/opt/bin SHELL=/bin/sh
# echo $(env)
PATH=/opt/bin:/opt/sbin:/bin:/usr/bin:/sbin:/usr/sbin:/home/root:/mmc/sbin:/mmc/bin:/mmc/usr/sbin:/mmc/usr/bin:/opt/sbin:/opt/bin:/opt/usr/sbin:/opt/usr/bin: SHELL=/bin/sh
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @dulemis on GitHub (Oct 3, 2017).
Having an issue with crontab. On the command line everything works, but in crontab the ouput of the same command is (sent to file):
INFO: Using main config file /jffs/LetsEncrypt/config
Nothing more. When running it on the command line everything works, I'm amanually specifying the configuration path with --config. Any idea what could be causing this?
@jobe1986 commented on GitHub (Oct 3, 2017):
Are you running it directly from the crontab or are you wrapping it in a script?
Personally I use a simple shell script that first cd's to the directory containing dehydrated and the config file and then have the script call ./dehydrated -c
@dulemis commented on GitHub (Oct 3, 2017):
Directly, but I have tried your suggestion too without any change.
@Aikhjarto commented on GitHub (Oct 4, 2017):
Just a wild guess: A common pitfall using crontab is the $PATH environmental variable. On lots of systems an application started from a shell (with a user logged in) uses a different $PATH variable than the same application started via crontab.
So make sure to have all tools required by dehydrated in the $PATH that is used by crontab.
@dulemis commented on GitHub (Oct 4, 2017):
I've run a test script with cron outputting the path, and compared it with the path with the same user logged on to the shell. Do you see any differences that could be causing the problem?
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/opt/sbin:/opt/bin SHELL=/bin/sh
echo $(env)
PATH=/opt/bin:/opt/sbin:/bin:/usr/bin:/sbin:/usr/sbin:/home/root:/mmc/sbin:/mmc/bin:/mmc/usr/sbin:/mmc/usr/bin:/opt/sbin:/opt/bin:/opt/usr/sbin:/opt/usr/bin: SHELL=/bin/sh
@Aikhjarto commented on GitHub (Oct 4, 2017):
Obviously the $PATH is different.
Just make them equal and see if anything changes.
@dulemis commented on GitHub (Oct 4, 2017):
Thank you very much, I added it to the wrapper shell script and it did the trick!