.\" Copyright (c) 2003-2012 .\" Distributed Systems Software. All rights reserved. .\" See the file LICENSE for redistribution information. .\" $Id: copyright-nr 2564 2012-03-02 00:17:08Z brachman $ '\" t .\" Title: dacssched .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 02/19/2019 .\" Manual: DACS Commands Manual .\" Source: DACS 1.4.40 .\" Language: English .\" .TH "DACSSCHED" "1" "02/19/2019" "DACS 1.4.40" "DACS Commands Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" dacssched \- rule\-based command scheduling .SH "SYNOPSIS" .HP \w'\fBdacssched\fR\ 'u \fBdacssched\fR [\fB\-h\fR | \fB\-help\fR] [\fB\-ll\ \fR\fB\fIlog_level\fR\fR] [\fB\-q\fR] [{\fB\-r\fR\ |\ \fB\-rules\fR}\ \fIrules_uri\fR] [{\fB\-s\fR\ |\ \fB\-sched\fR}\ \fIsched_uri\fR] [\fB\-v\fR] .HP \w'\fBdacssched\fR\ 'u \fBdacssched\fR \fB\-\-version\fR .SH "DESCRIPTION" .PP This program is part of the \fBDACS\fR suite\&. It is a stand\-alone program that neither accepts the usual \fBDACS\fR command line options (\fIdacsoptions\fR) nor accesses any \fBDACS\fR configuration files\&. .PP The \fBdacssched\fR command runs other programs when specified conditions have been met\&. It does this by periodically examining a schedule, which, for each scheduled event, identifies the necessary conditions and the command line to be executed should the conditions be satisfied\&. Rules are stored separately from the schedule, although in a future version it might be possible to contain them with their schedule\&. .PP Although \fBdacssched\fR is conceptually similar to \m[blue]\fBcron(8)\fR\m[]\&\s-2\u[1]\d\s+2, \m[blue]\fBatrun(8)\fR\m[]\&\s-2\u[2]\d\s+2, and other programs used to schedule a command to be executed or a reminder to be sent at certain times or dates, there are some important differences\&. First, because the \fBDACS\fR rule evaluation engine is used, conditions much more broad and complex than simply the time or date can be used to schedule a command \- \fBDACS\fR \m[blue]\fBexpressions\fR\m[]\&\s-2\u[3]\d\s+2 are available\&. For instance, a rule to manage automated file backup could be written to take into account context other than simply the day of the week and the time of day, if necessary even running external programs to assist in making the determination\&. Second, both a schedule and the rules referenced by a schedule are accessed through the \fBDACS\fR virtual filestore, which means they can be stored in file or database, retrieved by HTTP, and so on\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .PP Although this program may be useful, it is currently merely a prototype intended for demonstration and experimentation purposes\&. Some configuration capabilities, features, and security steps required by a production version have not been implemented\&. The prototype must be invoked periodically; a production version would run in the background and automatically rescan the schedule at a given frequency\&. Note that because of its flexibility, the schedule must be polled at a suitable frequency \- in general, the program cannot compute when the next scheduled event will occur\&. Also because events need not be triggered by a time or date, some events may need to "self\-disabling" so that they are not repeatedly executed unintentionally\&. .sp .5v .RE .SS "Operation" .PP The program loads a \fIschedule\fR, which either comes from a default file or a location specified on the command line\&. A schedule is an ordinary text file, each line of which is either blank, a comment, or a scheduled event\&. The file is processed in the order in which the events appear from the top\&. Initial whitespace on any line is ignored\&. A comment line begins with a "#" character\&. A scheduled event consists of a \fIname\fR, followed by whitespace, followed by a command\&. If \fIname\fR evaluates to \fBTrue\fR (i\&.e\&., it grants access), the command is executed through \m[blue]\fBsystem(3)\fR\m[]\&\s-2\u[4]\d\s+2\&. If rule evaluation fails because of an error, the event is not executed\&. Events are not removed from the schedule after their command has been executed\&. .PP A \fIname\fR, which must begin with a slash, has no significance to \fBdacssched\fR; it is simply a label that is used to identify the rule to apply and is matched against a rule\*(Aqs service element\&. .PP Here is a simple schedule containing one event: .sp .if n \{\ .RS 4 .\} .nf # A simple schedule /setdate /usr/local/sbin/rdate \-a .fi .if n \{\ .RE .\} .sp If the condition labelled /setdate is \fBTrue\fR the specified command will be executed\&. .PP A simple rule such as the following might be associated with the event: .sp .if n \{\ .RS 4 .\} .nf time(hour) eq 2 and time(min) eq 0 .fi .if n \{\ .RE .\} .sp This rule enables the event /setdate at 2:00am every day\&. We will assume that the schedule is processed exactly once per minute\&. .PP Internally, \fBdacssched\fR converts the scheduled event above into the expression: .sp .if n \{\ .RS 4 .\} .nf rule("/setdate", \fIrule_uri\fR) .fi .if n \{\ .RE .\} .sp (where \fIrule_uri\fR specifies the ruleset to use) and then evaluates the expression\&. Please refer to the \m[blue]\fB\fBrule\fR predicate\fR\m[]\&\s-2\u[5]\d\s+2 for additional information\&. .SH "OPTIONS" .PP The arguments are processed as they are examined (left\-to\-right) and their ordering can be significant\&. .PP By default, the program will look for a schedule in the file \fI${Conf::DACS_HOME}\fR/dacssched/sched\&. (default: /usr/local/dacs/dacssched/sched) The default location for the rules is \fI${Conf::DACS_HOME}\fR/dacssched/acls\&. (default: /usr/local/dacs/dacssched/acls) .PP The following command line flags are recognized: .PP \fB\-h\fR .RS 4 Prints the usage blurb\&. .RE .PP \fB\-ll\fR \fIlog_level\fR .RS 4 Set the debugging output level to \fIlog_level\fR (see \m[blue]\fBdacs(1)\fR\m[]\&\s-2\u[6]\d\s+2)\&. The default level is warn, and the \fB\-v\fR flag bumps the level to debug or trace\&. .RE .PP \fB\-q\fR .RS 4 Be quiet, except for error messages\&. The \fB\-v\fR and \fB\-ll\fR flags are independent of this\&. .RE .PP \fB\-r\fR \fIrule_uri\fR .br \fB\-rules\fR \fIrule_uri\fR .RS 4 This flag specifies the ruleset to be used\&. It can be an absolute pathname or a URI in the syntax of the \m[blue]\fBVFS\fR\m[]\&\s-2\u[7]\d\s+2 configuration directive\&. Examples: .sp .if n \{\ .RS 4 .\} .nf \-r "[acls1]dacs\-fs:/local/acls" \-rules /usr/local/myrules .fi .if n \{\ .RE .\} .sp .RE .PP \fB\-s\fR \fIsched_uri\fR .br \fB\-sched\fR \fIsched_uri\fR .RS 4 This flag specifies the schedule\&. It can be an absolute pathname or a URI in the syntax of the \m[blue]\fBVFS\fR\m[]\&\s-2\u[7]\d\s+2 configuration directive\&. .RE .PP \fB\-v\fR .RS 4 Increase the level of debugging output\&. The flag may be repeated\&. .RE .PP \fB\-\-version\fR .RS 4 Display the program\*(Aqs version information and then exit\&. .RE .SH "DIAGNOSTICS" .PP The program exits 0 if everything was fine, 1 if an error occurred\&. .SH "SEE ALSO" .PP \m[blue]\fBdacs\&.exprs(5)\fR\m[]\&\s-2\u[3]\d\s+2, \m[blue]\fBdacs\&.acls(5)\fR\m[]\&\s-2\u[8]\d\s+2 .SH "AUTHOR" .PP Distributed Systems Software (\m[blue]\fBwww\&.dss\&.ca\fR\m[]\&\s-2\u[9]\d\s+2) .SH "COPYING" .PP Copyright \(co 2003\-2018 Distributed Systems Software\&. See the \m[blue]\fBLICENSE\fR\m[]\&\s-2\u[10]\d\s+2 file that accompanies the distribution for licensing information\&. .SH "NOTES" .IP " 1." 4 cron(8) .RS 4 \%https://www.freebsd.org/cgi/man.cgi?query=cron&apropos=0&sektion=8&manpath=FreeBSD+10.3-RELEASE&format=html .RE .IP " 2." 4 atrun(8) .RS 4 \%https://www.freebsd.org/cgi/man.cgi?query=atrun&apropos=0&sektion=8&manpath=FreeBSD+10.3-RELEASE&format=html .RE .IP " 3." 4 expressions .RS 4 \%http://dacs.dss.ca/man/dacs.exprs.5.html .RE .IP " 4." 4 system(3) .RS 4 \%https://www.freebsd.org/cgi/man.cgi?query=system&apropos=0&sektion=3&manpath=FreeBSD+10.3-RELEASE&format=html .RE .IP " 5." 4 \fBrule\fR predicate .RS 4 \%http://dacs.dss.ca/man/dacs.exprs.5.html#rule .RE .IP " 6." 4 dacs(1) .RS 4 \%http://dacs.dss.ca/man/dacs.1.html .RE .IP " 7." 4 VFS .RS 4 \%http://dacs.dss.ca/man/dacs.conf.5.html#VFS .RE .IP " 8." 4 dacs.acls(5) .RS 4 \%http://dacs.dss.ca/man/dacs.acls.5.html .RE .IP " 9." 4 www.dss.ca .RS 4 \%http://www.dss.ca .RE .IP "10." 4 LICENSE .RS 4 \%http://dacs.dss.ca/man/../misc/LICENSE .RE