mirror of
https://github.com/yavook/kiwi-cron.git
synced 2024-11-21 15:03:01 +00:00
cleanup
This commit is contained in:
parent
e415d0b7e0
commit
ff334bc603
1 changed files with 6 additions and 9 deletions
|
@ -5,29 +5,26 @@ cs_units="${2}"
|
||||||
cs_command="${3}"
|
cs_command="${3}"
|
||||||
|
|
||||||
if [ "${cs_every}" = "1" ]; then
|
if [ "${cs_every}" = "1" ]; then
|
||||||
cs_every=""
|
cs_every="*"
|
||||||
else
|
else
|
||||||
cs_every="/${cs_every}"
|
cs_every="*/${cs_every}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# generate valid random schedule values
|
|
||||||
# generally, "nighttime" and "weekend" will be preferred.
|
|
||||||
|
|
||||||
case "${cs_units}" in
|
case "${cs_units}" in
|
||||||
minute)
|
minute)
|
||||||
echo "*${cs_every} * * * * ${cs_command}"
|
echo "${cs_every} * * * * ${cs_command}"
|
||||||
;;
|
;;
|
||||||
hour)
|
hour)
|
||||||
echo "R *${cs_every} * * * ${cs_command}"
|
echo "R ${cs_every} * * * ${cs_command}"
|
||||||
;;
|
;;
|
||||||
day)
|
day)
|
||||||
echo "R R *${cs_every} * * ${cs_command}"
|
echo "R R ${cs_every} * * ${cs_command}"
|
||||||
;;
|
;;
|
||||||
week)
|
week)
|
||||||
echo "R R * * R ${cs_command}"
|
echo "R R * * R ${cs_command}"
|
||||||
;;
|
;;
|
||||||
month)
|
month)
|
||||||
echo "R R R *${cs_every} * ${cs_command}"
|
echo "R R R ${cs_every} * ${cs_command}"
|
||||||
;;
|
;;
|
||||||
year)
|
year)
|
||||||
echo "R R R R * ${cs_command}"
|
echo "R R R R * ${cs_command}"
|
||||||
|
|
Loading…
Reference in a new issue