Skip to content
Snippets Groups Projects
Commit f55b63de authored by Kevin Lyda's avatar Kevin Lyda :speech_balloon:
Browse files

Add docs and some utils.

parent 35f506a4
No related branches found
No related tags found
No related merge requests found
.\" Man page generated from reStructuredText.
.
.TH CHKCRONTAB 1 "" "" "Utilities"
.SH NAME
chkcrontab \- Crontab lint tool
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.SH SYNOPSIS
.sp
\fBchkcrontab\fP \fIfile\fP
.SH DESCRIPTION
.sp
The \fBchkcrontab\fP command provides a command line tool to check the
correctness of system crontab files like \fB/etc/crontab\fP or the
files in \fB/etc/cron.d\fP.
.sp
The following check are run against the given crontab file.
.INDENT 0.0
.IP \(bu 2
File name is a valid cron file name.
.IP \(bu 2
Variable assignments do not have \fB$\fP\(aqs in right hand side.
.IP \(bu 2
Confirms that \fB@\fP specifiers are valid.
.IP \(bu 2
Confirms that users exist on the system (or NIS or LDAP).
.IP \(bu 2
Validates the basic syntax of cron job lines.
.IP \(bu 2
Validates that each time field is within limits.
.IP \(bu 2
Checks that ranges and sequences are not used for the "day of
week" and "month" fields.
.IP \(bu 2
Reports any bare \fB%\fP in a command.
.UNINDENT
.SH BUGS
.sp
Quite possibly. Report them via the \fI\%issue tracker\fP at the project
website.
.SH SEE ALSO
.sp
\fBlint\fP (1)
.SH RESOURCES
.sp
Project website: \fI\%http://code.google.com/p/chkcrontab\fP
.SH COPYING
.sp
Copyright (C) 2012 Kevin Lyda.
Free use of this software is granted under the terms of the GNU General
Public License version 3 or any later version.
.SH AUTHOR
Kevin Lyda <lyda@google.com>
.\" Generated by docutils manpage writer.
.
==========
chkcrontab
==========
-----------------
Crontab lint tool
-----------------
:Author: Kevin Lyda <lyda@google.com>
:Manual section: 1
:Manual group: Utilities
Synopsis
--------
**chkcrontab** *file*
Description
-----------
The **chkcrontab** command provides a command line tool to check the
correctness of system crontab files like ``/etc/crontab`` or the
files in ``/etc/cron.d``.
The following check are run against the given crontab file.
* File name is a valid cron file name.
* Variable assignments do not have ``$``'s in right hand side.
* Confirms that ``@`` specifiers are valid.
* Confirms that users exist on the system (or NIS or LDAP).
* Validates the basic syntax of cron job lines.
* Validates that each time field is within limits.
* Checks that ranges and sequences are not used for the "day of
week" and "month" fields.
* Reports any bare ``%`` in a command.
Bugs
----
Quite possibly. Report them via the `issue tracker`_ at the project
website.
See Also
--------
**lint** (1)
Resources
---------
Project website: http://code.google.com/p/chkcrontab
Copying
-------
Copyright (C) 2012 Kevin Lyda.
Free use of this software is granted under the terms of the GNU General
Public License version 3 or any later version.
.. _`issue tracker`: http://code.google.com/p/chkcrontab/issues/list
#!/bin/bash
THIS_GIT_DIR="${0%/*}/.."
if [[ ! -f $THIS_GIT_DIR/.git/hooks/pre-commit ]]; then
cat > $THIS_GIT_DIR/.git/hooks/pre-commit << EOF
#!/bin/sh
./setup.py test
EOF
chmod 755 $THIS_GIT_DIR/.git/hooks/pre-commit
fi
#!/bin/bash
manpages="chkcrontab.1"
for mp in $manpages; do
if [[ ! -f doc/$mp.rst ]]; then
echo "Can't find $mp.rst - run in base dir."
exit 1
fi
rst2man.py doc/$mp.rst > doc/$mp
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment