#!/usr/bin/env zsh # # Copyright © 2011 Nick Bowler # # Simple script to dispatch jobs in /etc/cron.whatever. # # License WTFPL2: Do What The Fuck You Want To Public License, version 2. # This is free software: you are free to do what the fuck you want to. # There is NO WARRANTY, to the extent permitted by law. crondir=/etc/cron.$1 if ! [[ -d $crondir ]]; then printf '%s: argument must be one of:' $0 for i in /etc/cron.*; do if ! [[ -d $i ]]; then continue; fi printf ' %s' ${i#/etc/cron.} done echo . exit 1 fi run-parts --verbose --regex='^[^.][[:alnum:]_.-]+$' $crondir