I have a cron job that runs to detect if a certain application has frozen. If so it should kill the frozen application and restart it. The application is a Java program. When the application is frozen, my cron job tries to kill it using
The cron runs that .sh file but in my logs I'm getting permission denied. I'm assuming its because of the user cron?
pkill -9 java
, but it says permission not given due to cron not being able to kill java
. But I can run this command fine as the user. What am I doing wrong?
*update below is the cron line i use:
*/20 * * * * /bin/bash /home/userabc/node_checker.sh >> /home/userabc/node_checker.log
That runs this file:

Asked by Patoshi パトシ
(1855 rep)
Jun 26, 2020, 12:59 PM
Last activity: Jun 26, 2020, 05:45 PM
Last activity: Jun 26, 2020, 05:45 PM