]> git.draconx.ca Git - scripts.git/blob - runcron.zsh
Mostly rewrite musicstats.zsh.
[scripts.git] / runcron.zsh
1 #!/usr/bin/env zsh
2 #
3 # Copyright © 2011 Nick Bowler
4 #
5 # Simple script to dispatch jobs in /etc/cron.whatever.
6 #
7 # License WTFPL2: Do What The Fuck You Want To Public License, version 2.
8 # This is free software: you are free to do what the fuck you want to.
9 # There is NO WARRANTY, to the extent permitted by law.
10
11 crondir=/etc/cron.$1
12
13 if ! [[ -d $crondir ]]; then
14         printf '%s: argument must be one of:' $0
15         for i in /etc/cron.*; do
16                 if ! [[ -d $i ]]; then continue; fi
17                 printf ' %s' ${i#/etc/cron.}
18         done
19         echo .
20
21         exit 1
22 fi
23
24 run-parts --verbose --regex='^[^.][[:alnum:]_.-]+$' $crondir