Cron Verifying expressions is not working


(Yuvraj Gupta) #1

In X-Pack under Watcher we have schedule triggers which supports cron expressions.

Upon validating cron expression using the croneval {Present in $ES_HOME/bin/x-pack} utility provided, it gives following error:-

Command used:-
bin/x-pack/croneval "0 0/1 * * * ?"

yuvraj@ubuntu:~/Downloads/ElasticStack5.0/Alpha4/elasticsearch-5.0.0-alpha4$ bin/x-pack/croneval "0 0/1 * * * ?"
Validates and evaluates a cron expression

Non-option arguments:
expression           

Option         Description                    
------         -----------                    
-c, --count    The number of future times this
                 expression will be triggered 
                 (default: 10)                
-h, --help     show help                      
-s, --silent   show minimal output            
-v, --verbose  show verbose output            
ERROR: E is not a recognized option


(Alexander Reelsen) #2

Hey,

this has been fixed with the rc1 release. Sorry for the delay!

--Alex


(Nick Erber) #3

Hey,

old post, but using elasticsearch 5.4.0 this error seems to occur again.
Using command (from documentation) :

/usr/share/elasticsearch# bin/x-pack/croneval "0 0/1 * * * ?"
Validates and evaluates a cron expression

Non-option arguments:
expression

Option         Description
------         -----------
-c, --count    The number of future times this expression will be triggered
             (default: 10)
-h, --help     show help
-s, --silent   show minimal output
-v, --verbose  show verbose output
ERROR: E is not a recognized option
/usr/share/elasticsearch#

Did it change again?


(Alexander Reelsen) #4

Hey,

this works for me on a fresh installed 5.4.0 installation:

bin/x-pack/croneval "0 0/1 * * * ?"
Valid!
Now is [Wed, 17 May 2017 06:56:50]
Here are the next 10 times this cron expression will trigger:
1.	Wed, 17 May 2017 08:57:00
...

Is the plugin as well as the croneval script updated?

Can you share the output of

ls -l bin/x-pack/croneval

and

# sha1sum bin/x-pack/croneval
eba40f113a13e9e07d51eb18bdb1a51e8470536d  bin/x-pack/croneval

Also, how did you install elasticsearch and x-pack?

--Alex


(system) #5