I want my cron job to run every hour, every day except Friday when I don't want it to run at all between the hours of 2am-9am (but hourly outside of this timeframe). Ideally, I'd like to have this in one line/one cron job. What I have so far is 2 lines (and I'm not 100% sure it is correct):0 0 * * 0,1,2,3,4,6 script.sh0 0-1,10-23 * * 5 script.sh
Cron Job Hourly Except Certain Time Frame on Friday
shell;shell script;cron;scheduling
The format seems to be correct (after correction applied posted in the comment above). Are there some special restrictions for having everything in a single line? In case you need to have everything in a single line, I would suggest to change the shell script to avoid Fridays 2-9am, eg#!/bin/bash# THIS CODE IS NOT TESTED# skip on fridays 2-9am# what are the non-running times?STARTTIME=2ENDTIME=9# get the current day of the weekDAY=$(date +%u) # 1-Monday, therefore 5-Friday# and the hourHOUR=$(date +%H)if [ $DAY -eq 5 -a $HOUR -ge $STARTTIME -a $HOUR -le $ENDTIME ]then   # end the execution   exit 0fiHope that helps to solve the issue!Frank