cron - daemon to execute scheduled commands (Belga Cron)
cron [B<-F> F<file>] [B<-L> I<log>] [B<-M>] [B<-O>] [B<-S>] [B<-U>] [B
+<-X>] [B<-f> F<file>] [B<-h>] [B<-s>] [B<-x> [I<debugflag>]]
Same as Vixie Cron blah blah blah.
Exit after running through the list of jobs once.
=item B<-F> F<crontab>
Like B<-f> below except that it expects a user (6th) field.
=item B<-L> I<log>
Absolute path to write logs; files named errors, info, and warnings; i
There are two special values you can set B<-L> to
no logging is done
output is sent to STDOUT
Repress all sending of mail.
To process a job B<cron> forks and then the specified command.
With B<-O> commands denoted by C<#!perl -e> are C<eval>d by the child,
saving the overhead of invoking a new interpreter when running perl sc
such jobs are ignored if B<-O> is not supplied.
Even though this has been designed to be as safe as possible
be sure you understand the potential security implications.
Prevents magic open and rumored implict C<fork>, forces B<-U>.
This prevents setUID and setGID, that is it effectively ignores
the GID environment variable as well as the user (6th) field of
crontabs run as root or with B<-F>.
Prevents B<cron> from daemonizing; forces B<-s> and does not seperate
from the terminal.
=item B<-f> F<crontab>
Supply a specific crontab or directory of crontabs to parse;
ignoring the system default and spool directories.
Especially useful for debugging or running multiple daemons.
You might want to consider using B<-L> as well.
Print short usage message, and exit.
This prevents forking which forces B<cron> to serialize job processing
This can produce unexpected results if you are setUIDing; running jobs
via B<-F> or from F</etc/crontab> or F</etc/cron.d>.
=item B<-x> [I<debugflag>]
Log debugging information.
basic status messages
crontab parsing messages
job checking messages
You may add the values together to form a composite mode.
=item Can't read from NULL device: AAA
Couldn't open STDIN from your NULL device e.g; /dev/null.
This is a common procedure for daemons. Don't you have a NULL?
=item Couldn't chdir to ROOT directory: AAA
Couldn't change to ROOT directory.
This is a common procedure for daemons. Don't you have a root?
=item Couldn't fork: AAA
B<Cron> needs to C<fork> in order to handle all the SetUIDing
it does for security. It tries to catch perls which cannot
C<fork> and C<die>s, though a B<-X> will prevent this test.
You may also get this error if your process table is full
or there is insufficient memory to create a child to execute a job.
The job was skipped.
=item Couldn't open AAA: BBB
B<Cron> was unable to open crontab AAA.
=item Couldn't create pipe: AAA
B<Cron> was unable to create a pipe which is necessary for
The job was skipped.
=item Couldn't setregid(AAA, BBB): CCC
A child was unable to change from group ID(s) AAA to effective
group ID(s) BBB before executing a job and exited.
The job was skipped.
=item Couldn't setreuid(AAA, BBB): CCC
A child was unable to change from user ID AAA to effective
user ID BBB before executing a job and exited.
The job was skipped.
=item Embedded newlines (%) not allowed with -s
B<Cron> uses nothing save PATH from it's environment.
However crontabs may contain environment variable settings for jobs.
These are a generalization of CRONLOG. They map
to options and allow one to system-wide defaults
Adopted from Sun's Cron which allows you to control logging
with this setting in a crontab.
This defaults to F</var/log/cron/>; and is equivalent to B<-L> I<log>.
This defaults to YES; NO is equivalent to B<-X>.
This defaults to NO; YES is equivalent to B<-x>.
This defaults to NO; YES is equivalent to B<-O>.
This defaults to YES; NO is equivalent to B<-M>.
This defaults to NO; YES is equivalent to B<-1>.
This defaults to NO; YES is equivalent to B<-s>.
This defaults to NO; YES is equivalent to B<-S>.
Specify the groups the job process will be a member of;
this is a colon delimited list like PATH.
Another extension from Sun's Cron. If SUPATH is set it is used
in lieu of PATH for jobs run as root.
=item F</var/spool/cron> OR F</var/spool/cron/crontabs> (Solaris)
These are the default crontabs that list the jobs B<cron> is supposed
Adopted from Sun's Cron. System wide default settings,
environment and options.
NOTE: This file is only read at startup and not monitored for changes.
B<Cron> logs its various messages to these files. See B<-L>.
The crontab parser ought to be validating, and bail if it encounters
something that doesn't look like a crontab. For now using crontab(1)
is recommended, as it validates and will catch any errors avoiding nas
Embedded newlines (%) in jobs require that your B<perl> implements C<p
For hopefully obvious reasons; *cough* hashes *cough*; I<%> are not
considered newlines for embedded perl jobs.
Embedded perl (B<-O>) with B<-S> requires that you have File::Temp ins
An interesting way to track jobs with GNU ps and grep is:
ps aux -H | grep -A 2 -i crond
=head1 SEE ALSO
cron(8), crontab(1), crontab(5)
Jerrad Pierce <firstname.lastname@example.org>
In case you hadn't noticed this is loosely modeled after Vixie Cron.
You ought to be able to find that at F<ftp://ftp.vix.com/pub/vixie/>
Almost every feature of Belga Cron is an extension of the original B<c
Most of them are specific to Belga Cron though some are derived from
Sun's implementation and are denoted as such. In addition
all extensions in Vixie Cron as of 3.0 are supported,
except use of !, namely
lists and ranges can co-exist in the same field
3 letter abbreviations of English names for months and days may be use
job output is mailed (or not) to a specified user
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||