Files
fdn2/private/bin/cronexec
T
Riccardo Di Dato 4ddbe4ffc2 Creato sistema di deploy (INPROGRESS)
Importate librerie fondamentali:
Logger (UNTESTED)
System (UNTESTED)
Dao (INCOMPLETE)
2015-12-22 22:08:30 +01:00

26 lines
586 B
Bash

#!/bin/bash
if [ -z "$1" ];
then
echo "Missing specifier"
exit 1
fi
if [ "$1" == "5minutes" ] || [ "$1" == "minute" ] || [ "$1" == "daily" ] || [ "$1" == "hourly" ] || [ "$1" == "monthly" ] || [ "$1" == "weekly" ];
then
BASEDIR=`pwd`
cd /eam/crontab/
logger "CRONEXEC Executing $1 tasks"
for i in `ls | grep -P "\.$1\."`
do
logger "Executing $i"
RESULT=`./$i`
logger "$RESULT"
done
cd "$BASEDIR"
else
echo "Invalid specifier $1"
exit 1
fi