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

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

Open Hand For more examples, see Samples.

 
Home | FAQ | News | Intro | Samples | Tutorial | Reference | Software
Developer's Notes | Licensing | Authors | Pikt-Users | Pikt-Workers | Related Projects | Site Index | Privacy Policy | Contact Us
Page best viewed at 1024x768 or greater.   Page last updated 2008-03-27.   This site is PIKT® powered.
PIKT® is a registered trademark of the University of Chicago.   Copyright © 1998-2008 Robert Osterlund. All rights reserved.
Home FAQ News Intro Samples Tutorial Reference Software
PIKT Logo
PIKT Page Title
Learn about the
PIKT alerts.cfg
config file