crontab: constraint order is month, day, day-of-week, hour, minute.

windows-drag
John Benediktsson 2019-03-22 20:42:46 -07:00
parent 0f0099b08d
commit ea83c1c1ee
1 changed files with 9 additions and 9 deletions

View File

@ -76,6 +76,14 @@ CONSTANT: aliases H{
cronentry days>> first >>day 1 +month
] if* [ cronentry timestamp (next-time-after) ] when
timestamp day-of-week :> weekday
cronentry days-of-week>> [ weekday >= ] find nip [
cronentry days-of-week>> first 7 +
] unless* weekday - [
timestamp 0 >>hour 0 >>minute swap +day drop
cronentry timestamp (next-time-after)
] unless-zero
timestamp hour>> :> hour
cronentry hours>> [ hour >= ] find nip [
dup hour = [ drop f ] [
@ -91,15 +99,7 @@ CONSTANT: aliases H{
dup minute = [ drop f ] [ timestamp minute<< t ] if
] [
timestamp cronentry minutes>> first >>minute 1 +hour
] if* [ cronentry timestamp (next-time-after) ] when
timestamp day-of-week :> weekday
cronentry days-of-week>> [ weekday >= ] find nip [
cronentry days-of-week>> first 7 +
] unless* weekday - [
timestamp swap +day drop
cronentry timestamp (next-time-after)
] unless-zero ;
] if* [ cronentry timestamp (next-time-after) ] when ;
PRIVATE>