WLOG - notes something different

cron

9front / plan9 provide cron support trough auth/cron command.

Do note, that cron implementation is basic and acts different that expected. As in, it is meant to be run on the auth server (not a standalone terminal) and it is not run by default.

startup

This is probably not the best way to do it, but examples are scarce.

exposition

The cron (auth/cron) daemon should be run on the auth server, since it works by logging on the specified machine and remotely executing commands using rx.

This presented two problems. What to do if one wants to run cron on a terminal (standalone) installation. And what to do with namespaces (privileges, mount points, ...) when the command is executed under "rx" session (not defined by default in lib/profile).

script

Presented here is a script (named runcron), which should be put in the bin/rc of the system owner user (default glenda).

For example purposes, let's assume the default, which would make this script reside in /usr/glenda/bin/rc/runcron:

#!/bin/rc
# runcron
# hack to run cron on a terminal (not an auth server)
# get script name to exclude from process list
sn=`{basename $0}
# check if cron should be run, even if no cleanupoccured (no cron processes but present lock file)
cpc=`{ps | grep cron | grep -v $sn | wc -l | awk '{print $1}'}
if (test $cpc -eq '0') {
    rm /cron/lock
    rfork
    # there should be only one
    auth/cron
}

This script should be then run from one of the start scripts handled by /bin/cpurc (for server) or /bin/termrc (for terminal). An appropriate location location would be configurable files which get included in /bin/rc in /cfg/SYSNAME/cpustart or /cfg/SYSNAME/termrc:

# hack to run cron
/usr/glenda/bin/rc/runcron

usage

Configuration is similar to other nix systems, albeit without advanced settings like @reboot or /x for intervals.

setup

To create an appropriate file for your user, run cron command with -c flag:

auth/cron -c

configuration

Cron definitions for every user reside in /cron/USER/cron file.

The configuration is: minute hour dayOFmonth monthOFyeah dayOFweek sysname command

To run the command on the local system, the keyword local can be used instead of the system name.