1
0
Fork 0
mirror of https://github.com/yavook/kiwi-cron.git synced 2024-11-21 15:03:01 +00:00
This commit is contained in:
Jörn-Michael Miehe 2022-03-03 00:26:50 +01:00
parent e415d0b7e0
commit ff334bc603

View file

@ -5,29 +5,26 @@ cs_units="${2}"
cs_command="${3}"
if [ "${cs_every}" = "1" ]; then
cs_every=""
cs_every="*"
else
cs_every="/${cs_every}"
cs_every="*/${cs_every}"
fi
# generate valid random schedule values
# generally, "nighttime" and "weekend" will be preferred.
case "${cs_units}" in
minute)
echo "*${cs_every} * * * * ${cs_command}"
echo "${cs_every} * * * * ${cs_command}"
;;
hour)
echo "R *${cs_every} * * * ${cs_command}"
echo "R ${cs_every} * * * ${cs_command}"
;;
day)
echo "R R *${cs_every} * * ${cs_command}"
echo "R R ${cs_every} * * ${cs_command}"
;;
week)
echo "R R * * R ${cs_command}"
;;
month)
echo "R R R *${cs_every} * ${cs_command}"
echo "R R R ${cs_every} * ${cs_command}"
;;
year)
echo "R R R R * ${cs_command}"