<commit_before>[![Build Status](https://travis-ci.org/bootique-examples/bootique-jobs-demo.svg)](https://travis-ci.org/bootique-examples/bootique-jobs-demo)

# bootique-jobs-demo

An example that explains how to write jobs on Bootique platform. Jobs can be run individually from command line, or scheduled with internal scheduler.

*For additional help/questions about this example send a message to
[Bootique forum](https://groups.google.com/forum/#!forum/bootique-user).*

## Prerequisites

* Java 1.8 or newer.
* Apache Maven.

## Build the Demo

Here is how to build it:

	git clone <EMAIL>:bootique-examples/bootique-jobs-demo.git
	cd bootique-jobs-demo
	mvn package

## Run the Demo

Now you can check the options available in your app:

	java -jar target/bootique-jobs-demo-1.0-SNAPSHOT.jar

	Option                    Description
    ------                    -----------
    --config <yaml_location>  Specifies YAML config location, which
                                can be a file path or a URL.
    --exec                    Executes one or more jobs. Jobs are
                                specified with '--job' options
    --help                    Prints this message.
    --job <job_name>          Specifies the name of the job to run
                                with '--exec'. Available job names
                                can be viewed using '--list' command.
    --list                    Lists all jobs available in the app
    --schedule                Schedules and executes jobs according
                                to configuration. Waits indefinitely
                                on the foreground.

One of the options is ```--list``` that tells you what jobs are available:

    java -jar target/bootique-jobs-demo-1.0-SNAPSHOT.jar --list<commit_msg>readme: format help options<commit_after>[![Build Status](https://travis-ci.org/bootique-examples/bootique-jobs-demo.svg)](https://travis-ci.org/bootique-examples/bootique-jobs-demo)

# bootique-jobs-demo

An example that explains how to write jobs on [Bootique](http://bootique.io) platform. Jobs can be run individually from command line, or scheduled with internal scheduler.

*For additional help/questions about this example send a message to
[Bootique forum](https://groups.google.com/forum/#!forum/bootique-user).*

## Prerequisites

* Java 1.8 or newer.
* Apache Maven.

## Build the Demo

Here is how to build it:

	git clone <EMAIL>:bootique-examples/bootique-jobs-demo.git
	cd bootique-jobs-demo
	mvn package

## Run the Demo

Now you can check the options available in your app:

    java -jar target/bootique-jobs-demo-1.0-SNAPSHOT.jar

    OPTIONS
          -c yaml_location, --config=yaml_location
               Specifies YAML config location, which can be a file path or a URL.
    
          -e, --exec
               Executes one or more jobs. Jobs are specified with '--job' options
    
          -h, --help
               Prints this message.
    
          -H, --help-config
               Prints information about application modules and their configuration
               options.
    
          -j job_name, --job=job_name
               Specifies the name of the job to run with '--exec'. Available job
               names can be viewed using '--list' command.
    
          -l, --list
               Lists all jobs available in the app
    
          --schedule
               Schedules and executes jobs according to configuration. Waits
               indefinitely on the foreground.
    
          --serial
               Enforces sequential execution of the jobs, specified with '--job'
               options.

One of the options is ```--list``` that tells you what jobs are available:

    java -jar target/bootique-jobs-demo-1.0-SNAPSHOT.jar --list
{'fraction_non_alphanumeric': 0.08879492600422834, 'fraction_numerical': 0.003171247357293869, 'mean_word_length': 1.95703125, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2030827', 'n_tokens_mistral': 1068, 'n_tokens_neox': 1001, 'n_words': 368}