Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ping fails inside cron #46

Closed
ProfM2 opened this issue Dec 28, 2018 · 4 comments
Closed

Ping fails inside cron #46

ProfM2 opened this issue Dec 28, 2018 · 4 comments

Comments

@ProfM2
Copy link

ProfM2 commented Dec 28, 2018

I have Ping setup inside of a command-line script that, when run on the command-line, everything works great. I get valid data.

However, when I place the exact same command inside of a crontab, Ping returns with a 'false', however the rest of the script works perfectly, so I know that everything is running fine.

I'm using the exec() style of calling. Is there a better method to get valid data from within a cron job?

@Mjuk-Biltvatt
Copy link

@ProfM2 did you ever find a solution?

@ProfM2
Copy link
Author

ProfM2 commented Oct 15, 2019

Unfortunately no. I ended up removing the ping check for the cron process.

@ProfM2
Copy link
Author

ProfM2 commented Dec 4, 2019

Well, I needed this feature to work, so after a bit of testing, discovered in my crontab file, /bin was not in the path. After adding that, ping works great.

@ProfM2 ProfM2 closed this as completed Dec 4, 2019
@geerlingguy
Copy link
Owner

Thanks for posting your solution! Just noting that 99% of the time when I have an issue that comes up during cron runs but not when run as the regular user, it comes down to the $PATH or some other env variable being different.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants