9.6. Sample Time Based Expressions
The following command configures an expression that is true if now is any time in the year 2005.
pcs constraint location Webserver rule score=INFINITY date-spec years=2005
# pcs constraint location Webserver rule score=INFINITY date-spec years=2005
The following command configures an expression that is true from 9am to 5pm, Monday through Friday. Note that the hours value of 16 matches up to 16:59:59, as the numeric value (hour) still matches.
pcs constraint location Webserver rule score=INFINITY date-spec hours="9-16" weekdays="1-5"
# pcs constraint location Webserver rule score=INFINITY date-spec hours="9-16" weekdays="1-5"
The following command configures an expression that is true when there is a full moon on Friday the 13th.
pcs constraint location Webserver rule date-spec weekdays=5 monthdays=13 moon=4
# pcs constraint location Webserver rule date-spec weekdays=5 monthdays=13 moon=4