Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Take A QuizChallenge yourself and boost your learning! Start the quiz now to earn credits.
Take A QuizUnlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
Take A QuizKindly log in to use this feature. We’ll take you to the login page automatically.
LoginGeneral Tech Bugs & Fixes 3 years ago
User submissions are the sole responsibility of contributors, with TuteeHUB disclaiming liability for accuracy, copyrights, or consequences of use; content is for informational purposes only and not professional advice.
Remember that Cron will run with a very minimal environment. Certain important things like PATH may be different then what you expected.
Try logging the output of the command to syslog, like this:
*/5 * * * * /home/regularuser/call.sh 2>&1 | logger -t call.sh
This will print any stdout and stderr to your system logs, usually to /var/log/messages . From here, use 'grep call.sh /var/log/messages' to see your error, which will likely be 1-2 lines.
I often prefer to log errors like this, instead of spamming email. But this is only useful for short messages.
Once you find the error message, update your question with the error. Or, you might be able to figure this out for yourself ;)
No matter what stage you're at in your education or career, TuteeHUB will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
Kindly log in to use this feature. We’ll take you to the login page automatically.
LoginReady to take your education and career to the next level? Register today and join our growing community of learners and professionals.
Your experience on this site will be improved by allowing cookies. Read Cookie Policy
Your experience on this site will be improved by allowing cookies. Read Cookie Policy
manpreet
Best Answer
3 years ago
I'm trying to call a shell script every 5 minutes, witch executes php file under root.
permissions:
call.sh contents:
My problem is that my php file doesn't get executed via crontab. However, if I call call.sh - everything works perfectly.
I'm new to crontab and shell scripting, so any advice/resources are welcome.