Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
NikolayNikolay
Explorer
Jump to solution

Job Scheduler does not run the script

Check Point R81.20 
Hello everyone, the script won't run through Job Scheduler, although it works when I run it manually. The script is needed to track the active provider. I am currently testing this script on a test bench.

I gave 755 rights to execute the script.

configuration of Job Scheduler:
add cron job test command "/home/admin/routewatch.sh" recurrence interval minutes 02

script:

#!/bin/bash
RFILE="/var/tmp/defroute_prev"
CURR=$(/sbin/ip route show 0.0.0.0/0)

if [ -f $RFILE ]; then
DIFF=$(/usr/bin/diff $RFILE <(echo "$CURR"))
if [ -n "$DIFF" ]; then
echo "$(/bin/date): Default route changed:" >> /var/log/defroute.log
echo "$DIFF" >> /var/log/defroute.log
fi
fi

echo "$CURR" > $RFILE

 

 

Please tell me why it doesn't work through Job Scheduler and where I can view the cron logs. Thanks in advance.

0 Kudos
1 Solution

Accepted Solutions
Lesley
MVP Gold
MVP Gold

chmod a+x /home/admin/routewatch.sh

dos2unix /home/admin/routewatch.sh

make sure time is set correctly with NPT 

/bin/date

clish -> show configuration ntp

-------
Please press "Accept as Solution" if my post solved it 🙂

View solution in original post

2 Replies
Lesley
MVP Gold
MVP Gold

chmod a+x /home/admin/routewatch.sh

dos2unix /home/admin/routewatch.sh

make sure time is set correctly with NPT 

/bin/date

clish -> show configuration ntp

-------
Please press "Accept as Solution" if my post solved it 🙂
the_rock
MVP Platinum
MVP Platinum

Steps Lesley gave make sense, let us know if they work for you.

Best,
Andy
0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events