Crontab #255

Closed
opened 2025-12-29 01:20:23 +01:00 by adam · 6 comments
Owner

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?
adam closed this issue 2025-12-29 01:20:23 +01:00
Author
Owner

@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

@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
Author
Owner

@dulemis commented on GitHub (Oct 3, 2017):

Directly, but I have tried your suggestion too without any change.

@dulemis commented on GitHub (Oct 3, 2017): Directly, but I have tried your suggestion too without any change.
Author
Owner

@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.

@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.
Author
Owner

@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

@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
Author
Owner

@Aikhjarto commented on GitHub (Oct 4, 2017):

Obviously the $PATH is different.
Just make them equal and see if anything changes.

@Aikhjarto commented on GitHub (Oct 4, 2017): Obviously the $PATH is different. Just make them equal and see if anything changes.
Author
Owner

@dulemis commented on GitHub (Oct 4, 2017):

Thank you very much, I added it to the wrapper shell script and it did the trick!

@dulemis commented on GitHub (Oct 4, 2017): Thank you very much, I added it to the wrapper shell script and it did the trick!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/dehydrated#255