Doesn't work in crontab? #1979
-
I am running a cronjob which calls a python script which has subprocess checkoutput. I tried a simple script to debug.
Output when ran in the shell: I get the output i needed
I created a cron job to run in crontab -e
/home/sgadamse/history_checker/code/rg is the complete rg binary path that i downloaded and using it. Do we need to do anything differently for the the cron jobs to execute the binary? Thanks. Edit: Any idea why its not searching only stdin? Edit2: I tried the grep command with exact cron job and python script and works as expected. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
From the Python docs for subprocess, emphasis mine:
My guess is that your cron system is attaching something to stdin that is being inherited by your Python process. Try using Alternatively, tell ripgrep to search a specific thing instead of having to guess. e.g., |
Beta Was this translation helpful? Give feedback.
From the Python docs for subprocess, emphasis mine:
My guess is that your cron system is attaching something to stdin that is being inherited by your Python process. Try using
stdin=subprocess.…