Stop Cron job for a particular time interval
Solution 1:
Stick this at the top of your cron job script (modified as you need)...
if [[ $(date +%u) -eq 7 && $(date +%H) -eq 16 ]]; then
echo "I don't run at this time"
exit 1
fi
echo "Something to do at other times here..."
The first instance of "date" returns the day of week (Sunday = 7), the second returns the hour (16 = 4.00pm - 4.59pm). If the script finds that it's currently day 7 and hour 16, it will exit.
Solution 2:
What about:
*/5 * * * * job.sh > /dev/null
00 16 * * 0 touch /tmp/stopJob.lck
00 17 * * 0 rm -f /tmp/stopJob.lck
In job.sh
just quit if the file exists:
if [ -f /tmp/stopJob.lck ]
then
exit
fi