Scheduling Macros
The macros in the sample scheduling_macros.cfg configuration file below are for scheduling script operation -- to bypass certain times or days of the week, for example.
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// scheduling_macros.cfg -- script scheduling
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
offhours(H) // between 10 PM and 6 AM
((H) >= 22 || (H) < 6)
allhours(H) // any time of the day or night
#true()
always =allhours(#now())
///////////////////////////////////////////////////////////////////////////////
testtiming(M) (M) 8-14/2 * * * 1
///////////////////////////////////////////////////////////////////////////////
reboot_period(D, H) // (D) is currently unused
#if server
( (H) >= 22 // between 10 PM
&& (H) < 23 // and 11 PM
)
#else
( (H) >= 25 ) // i.e., never
#endif
///////////////////////////////////////////////////////////////////////////////
bypass_reboots
if $host =~ "server"
if =reboot_period(#weekday(), #hour())
next
fi
fi
///////////////////////////////////////////////////////////////////////////////
bypass_weekend
if ( =friday && =evening )
|| ( =saturday )
|| ( =sunday && ! =evening )
quit
fi
///////////////////////////////////////////////////////////////////////////////
bypass_day_rollover
if ( #hour() == 22 )
|| ( #hour() == 23 )
|| ( #hour() == 0 && #minute() < 30 )
quit
fi
///////////////////////////////////////////////////////////////////////////////
bypass_evening
if =evening
quit
fi
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
For more examples, see Samples.