CONSFIGURATOR.PROPERTY.PERIODIC

API reference

General

Macro: PERIODIC:AT-MOST

(periodic:at-most period desc &body propapps)

Only attempt to apply PROPAPPS at most every PERIOD. Supported values for PERIOD are :each-reboot, :hourly, :daily, :weekly, :monthly, :yearly. It is assumed that a month has 30 days and a year has 365.25 days.

The purpose of this combinator is to avoid applying properties that are expensive to apply more often than it is useful to apply them. It is not for scheduling tasks to occur at specific times or on specific days.

The application of PROPAPPS is tracked by creating a flagfile on the remote with a name computed from DESC. The mtime of this file is examined to determine whether PERIOD has passed and another attempt to apply PROPAPPS should be made. Thus, you must ensure that DESC is unique among the descriptions of all the properties that will be applied to this host as this user.

Macro: PERIODIC:REAPPLIED-AT-MOST

(periodic:reapplied-at-most period desc &body propapps)

Apply PROPAPPS; only every PERIOD, also unapply them before applying them.

This is useful to periodically redo the application of PROPAPPS. For example, you can use this to occasionally completely rebuild a CHROOT:OS-BOOTSTRAPPED chroot instead of only ever updating its contents.

PERIOD and DESC are as for PERIODIC:AT-MOST, which see.