From 943ea8dbd32cb69957544580ecfccc9b79ac6d47 Mon Sep 17 00:00:00 2001 From: Aurélien DESBRIÈRES Date: Thu, 9 Oct 2014 18:41:01 +0200 Subject: A standards compliant and convenient cron service. --- pcr/mycron-git/PKGBUILD | 47 +++++++++++++++++++---------------- pcr/mycron-git/mycron.1 | 35 ++++++++------------------ pcr/mycron-git/mycron.conf.5 | 33 +++++++++++++++++++++++++ pcr/mycron-git/mycron.crontab.5 | 55 +++++++++++++++++++++++++++++++++++++++++ pcr/mycron-git/mycron.install | 6 ++++- pcr/mycron-git/mycron@.service | 11 +++++++++ 6 files changed, 140 insertions(+), 47 deletions(-) create mode 100644 pcr/mycron-git/mycron.conf.5 create mode 100644 pcr/mycron-git/mycron.crontab.5 create mode 100644 pcr/mycron-git/mycron@.service (limited to 'pcr/mycron-git') diff --git a/pcr/mycron-git/PKGBUILD b/pcr/mycron-git/PKGBUILD index d9eb795b6..19fbd7bd5 100644 --- a/pcr/mycron-git/PKGBUILD +++ b/pcr/mycron-git/PKGBUILD @@ -1,14 +1,14 @@ -# Contributor (Arch) : Dirk Sohler -# Contributor (Arch) : Dirk Sohler -# Maintainer (Parabola): Aurélien DESBRIÈRES +# Maintainer : Aurélien DESBRIÈRES +# Contributor: Dirk Sohler +# Contributor: Dirk Sohler pkgname=mycron-git _gitname=mycron -pkgver=2.0.2 +pkgver=3.0 pkgrel=2 -pkgdesc='A standards compliant and convenient crontab management system.' +pkgdesc='A standards compliant and convenient cron service.' -url='http://dev.0x7be.de/mycron.html' +url='https://dev.0x7be.de/mycron.html' arch=('any') license=('GPL') @@ -19,25 +19,30 @@ install=mycron.install branch='master' source=("git://github.com/dsohler/mycron.git#branch=$branch" - 'mycron.install' + 'mycron.install' 'mycron.1' - 'mycron.5') + 'mycron.conf.5' + 'mycron.crontab.5' + 'mycron@.service') + pkgver() { - cd "$srcdir/$_gitname" - echo $(sed -n "s/^progversion='\(.*\)'/\1/p" mycron.py) + cd "$srcdir/$_gitname" + echo $(sed -n "s/^progversion = '\(.*\)'/\1/p" mycron.py) } package() { - cd "$srcdir/$_gitname" - _DOCPATH="usr/share/doc/mycron" - _MANPATH="usr/share/man" - install -Dm 755 mycron.py $pkgdir/usr/bin/mycron - install -Dm 644 example-config.cfg $pkgdir/$_DOCPATH/example-config.cfg - install -Dm 644 example.crontab $pkgdir/$_DOCPATH/example.crontab - install -Dm 644 crontab.vim $pkgdir/$_DOCPATH/crontab.vim - install -Dm 644 ../mycron.1 $pkgdir/$_MANPATH/man1/mycron.1 - install -Dm 644 ../mycron.5 $pkgdir/$_MANPATH/man5/mycron.5 - gzip $pkgdir/$_MANPATH/man1/mycron.1 - gzip $pkgdir/$_MANPATH/man5/mycron.5 + cd "$srcdir/$_gitname" + _DOCPATH="usr/share/doc/mycron" + _MANPATH="usr/share/man" + _SYSTEMD="usr/lib/systemd/system" + install -Dm 755 mycron.py $pkgdir/usr/bin/mycron + install -Dm 644 crontab.vim $pkgdir/$_DOCPATH/crontab.vim + install -Dm 644 ../mycron.1 $pkgdir/$_MANPATH/man1/mycron.1 + install -Dm 644 ../mycron.conf.5 $pkgdir/$_MANPATH/man5/mycron.conf.5 + install -Dm 644 ../mycron.crontab.5 $pkgdir/$_MANPATH/man5/mycron.crontab.5 + install -Dm 644 ../mycron@.service $pkgdir/$_SYSTEMD/mycron@.service + gzip $pkgdir/$_MANPATH/man1/mycron.1 + gzip $pkgdir/$_MANPATH/man5/mycron.conf.5 + gzip $pkgdir/$_MANPATH/man5/mycron.crontab.5 } diff --git a/pcr/mycron-git/mycron.1 b/pcr/mycron-git/mycron.1 index daef28f6f..47c001e17 100644 --- a/pcr/mycron-git/mycron.1 +++ b/pcr/mycron-git/mycron.1 @@ -1,50 +1,33 @@ -.TH mycron 1 "2013-01-13" 2.0.1 +.TH mycron 1 "2014-06-29" 3.0 .SH NAME -mycron - A standards compliant and convenient crontab management system. +mycron - A standards compliant and convenient alternative cronjob system. .SH SYNOPSIS .B mycron .RB [\| -h \|] -.RB [\| \-u -.IR C \|] .RB [\| -e \|] .RB [\| -l \|] -.RB [\| -s \|] .RB [\| -c \|] -.RB [\| -n \|] -.RB [\| -p \|] -.RB [\| -x \|] +.RB [\| -o \|] .SH DESCRIPTION -mycron is not a cron service/daemon. You need an already set up cron service for using mycron in a reasonable way. You need to set up your cronie\-, dcron\-, vixie\-, whatever\-crontab to execute mycron every minute for taking full advantage of mycron’s crontabs. +mycron is an alternative cron service/daemon. You need to start the systemd service unit or create a init.d file by yourself or simply start mycron manually for each user and run it in the background. .PP -mycron then replaces your regular crontab setup. It allows you to set up cronjobs in a completely new, but very convenient and standards compliant way and becomes your command center for managing, creating, editing and checking (multiple) crontabs. +mycron then replaces your regular crontab setup. It allows you to set up cronjobs in a completely new, but very convenient and standards compliant way and becomes your command center for managing, creating, editing and checking cronjobs. .SH OPTIONS .TP \fB\-h\fR, \fB\-\-help\fR show inline parameters help .TP -\fB\-u\fR \fIC\fR, \fB\-\-use\fR=\fIC\fR -use crontab \fIC\fR instead of default crontab. You can combine this with all other parameters. -.TP \fB\-e\fR, \fB\-\-edit\fR edit crontab (either the default crontab or the one specified by \fB\-u\fR) .TP -\fB\-s\fR, \fB\-\-show\fR -output a list showing all available crontabs, except x\- crontabs (see \fB\-x\fR for more details) -.TP \fB\-c\fR, \fB\-\-check\fR check the crontab for validity and show all lines that are invalid .TP -\fB\-n\fR, \fB\-\-no\-colors\fR -don't use colored output -.TP -\fB\-e\fR, \fB\-\-print\-examples\fR -show a list of examples for mycron crontab entries -.TP -\fB\-x\fR, \fB\-\-x\-crontabs\fR -show development crontabs, too. Development crontabs start with \fBx-\fR and are hidden by default when using \fB-s\fR. +\fB\-o\fR, \fB\-\-once\fR +only run once instead of continuous running .SH BUGS Please desist from using non-ASCII characters like German umlauts, other special symbols, etc. It will not break mycron or it's validity check, but fails on mycron actually executed by your cron daemon. @@ -56,4 +39,6 @@ The full documentation of \fBmycron\fR is available online at .SH SEE ALSO -mycron(5), crontab(1) +.BR mycron.crontab (5), +.BR mycron.conf (5), +.BR systemctl (1) diff --git a/pcr/mycron-git/mycron.conf.5 b/pcr/mycron-git/mycron.conf.5 new file mode 100644 index 000000000..f8fbdf414 --- /dev/null +++ b/pcr/mycron-git/mycron.conf.5 @@ -0,0 +1,33 @@ +.TH mycron.conf 5 "" "" "MYCRON CONFIGURATION FILE FORMAT" +.SH NAME +mycron.conf \- configuration files syntax and usage explaination + +.SH DESCRIPTION +\fBmycron\fRs configuration is always user controlled and defaults to the most useful/common values. + +.SH LOCATION +The configuration file has to be stored at \fB${HOME}/.config/mycron/mycron.conf\fR for \fBmycron\fR to recognize it. + +.SH EXAMPLE +Currently there can only the used editor be set. By default the environment variable \fB$VISUAL\fR will be used. Change that in the configuration file as needed. +.PP +.nf +.RS +[default] +editor = vim +.RE +.fi +.PP +The example changes the crontab editing program to \fBvim\fR and makes mycron using it for editing the crontab instead of \fB$VISUAL\fR. Maybe you need to add the \fBDISPLAY\fB environment variable to run GUI tools for editing the crontab. +.PP +You can always manually edit the crontab by opening \fB${HOME}/.config/mycron/mycron.crontab\fR in an editor of your choice. + +.SH FUTURE +It is planned to extend the functionality of the configuration file. + +.SH AUTHOR +Dirk Sohler, + +.SH SEE ALSO +.BR mycron (1), +.BR mycron.crontab (5) diff --git a/pcr/mycron-git/mycron.crontab.5 b/pcr/mycron-git/mycron.crontab.5 new file mode 100644 index 000000000..b9a0f8da9 --- /dev/null +++ b/pcr/mycron-git/mycron.crontab.5 @@ -0,0 +1,55 @@ +.TH mycron 5 "" "" "MYCRON FILE FORMAT" +.SH NAME +mycron \- special crontab syntax explaination + +.SH DESCRIPTION +\fBmycron\fRs crontab syntax differs from the usual crontab syntax a lot. Of course you have the date/time part and the command, but the definitions are ISO 8601 valid using a dot (\fB.\fR) as wildcard character. + +.SH LOCATION +The crontab has to be stored at \fB${HOME}/.config/mycron/mycron.crontab\fR for \fBmycron\fR to recognize it. Use \fBmycron -e\fR for creating and editing it in the correct location. + +.SH SYNTAX +.TP +\fBDate/Time format\fR +ISO 8601 specifies day/time notation with time zone. Because \fBmycron\fR is only exact to the minute, seconds and time zone are omitted. Set the date with \fBYYYY-MM-DD\fRT\fBHH:MM\fR where \fBYYYY\fR is the year, \fBMM\fR is the month, \fBDD\fR is the day, \fBHH\fR is the hour in 24h format and \fBMM\fR is the minute. For every single digit you can input a \fB.\fR (a single colon) as wildcard. +.TP +\fBDay of the week\fR +ISO 8601 specifies Monday as first day of the week and Sunday as last day of the week, therefore \fBMonday is 1\fR, \fBThursday is 2\fR, ..., \fBSunday is 7\fR. If you use \fB.\fR (a single colon), \fBmycron\fR interprets it as "every day". +.TP +\fBCommand\fR +The last of the three blocks is the command block. Here you can use whatever you want. Please desist from using non-ASCII characters like German umlauts, other special symbols, etc. It will not break mycron or it's validity check, but fails on mycron actually executed by your cron daemon. +.TP +\fBComments\fR +Comments are indicated by using \fB#\fR in the beginning of a line. It might work in most cases but you should not rely on comments after some actual crontab entries. (End-of-line comments) + +.SH EXAMPLES +.TP +\fB....-..-..T..:.. . command\fR +This line executes the command every minute at every day. +.TP +\fB....-..-..T18:57 7 command\fR +Here the command gets executed every Sunday at 18:57 o'clock. +.TP +\fB....-..-..T07:38 1267 command\fR +When given multiple digits for the day, the command gets executed on all of the days. Here on Mondays, Tuesdays, Saturdays and Sundays at 07:38 o'clock. +.TP +\fB2013-05-..T..:00 4 command\fR +This very specific line results in execution of the given command on every full hour at every Friday in May 2013. +.TP +\fB....-12-..T14:.. . command\fR +The command will be executed every minute from 14:00 to 14:59 o'clock on everyday in every December. +.TP +\fB2018-01-14T10:45 2 command\fR +Because 2018-01-14 is a Sunday (7) this command will \fBnever\fR be executed :) + +.SH FILES +.TP +\fBVim syntax file\fR +/usr/share/doc/mycron/crontab.vim + +.SH AUTHOR +Dirk Sohler, + +.SH SEE ALSO +.BR mycron (1), +.BR mycron.conf (5) diff --git a/pcr/mycron-git/mycron.install b/pcr/mycron-git/mycron.install index a56c1ab97..765d52b60 100644 --- a/pcr/mycron-git/mycron.install +++ b/pcr/mycron-git/mycron.install @@ -1,3 +1,7 @@ post_install() { - echo 'Don’t forget to set up your cron service/daemon to execute mycron every minute. See https://dev.0x7be.de/mycron for setup instructions and configuration examples.' | fold -sw 70 + echo 'Don’t forget to enable/start mycron with systemctl. See https://dev.0x7be.de/mycron.html for setup instructions and configuration examples.' | fold -sw 70 +} + +pre_upgrade() { + echo "Please note that ${1} is incompatible to versions prior to 2.9 because mycron is a fully-featured daemon/service now and no longer only a wrapper script. The multi-crontab-functionality and some other parts got removed due to general feature cleaning! If you’re already running a higher version it’s all fine." | fold -sw 70 } diff --git a/pcr/mycron-git/mycron@.service b/pcr/mycron-git/mycron@.service new file mode 100644 index 000000000..837bc0a1a --- /dev/null +++ b/pcr/mycron-git/mycron@.service @@ -0,0 +1,11 @@ +[Unit] +Description=mycron for %i +Wants=multi-user.target + +[Service] +User=%i +Restart=always +ExecStart=/usr/bin/mycron + +[Install] +WantedBy=multi-user.target -- cgit v1.2.3-54-g00ecf