...
Code Block |
---|
language | xml |
---|
title | dependency snippet from the jobscheduler.engine-1.9.6-pom |
---|
collapse | true |
---|
|
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>18.0</version>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.186</version>
</dependency>
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
<version>3.3</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.7</version>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>javax.persistence</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>org.scalactic</groupId>
<artifactId>scalactic_2.11</artifactId>
<version>2.2.4</version>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>2.11.6</version>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-reflect</artifactId>
<version>2.11.6</version>
</dependency>
<dependency>
<groupId>org.scala-lang.modules</groupId>
<artifactId>scala-xml_2.11</artifactId>
<version>1.0.3</version>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
<version>1.4.01</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>org.joda</groupId>
<artifactId>joda-convert</artifactId>
<version>1.7</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>8.1.16.v20140903</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
<version>8.1.16.v20140903</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlets</artifactId>
<version>8.1.16.v20140903</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-xml</artifactId>
<version>8.1.16.v20140903</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-client</artifactId>
<version>8.1.16.v20140903</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-webapp</artifactId>
<version>8.1.16.v20140903</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-websocket</artifactId>
<version>8.1.16.v20140903</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
<version>1.19</version>
</dependency>
<dependency>
<groupId>com.sun.jersey.contribs</groupId>
<artifactId>jersey-guice</artifactId>
<version>1.19</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>1.19</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.10</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.10</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
<version>1.7.10</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.4.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.4.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.4.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-json-provider</artifactId>
<version>2.4.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-guava</artifactId>
<version>2.4.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-scala_2.11</artifactId>
<version>2.4.3</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.2</version>
</dependency>
<dependency>
<groupId>io.spray</groupId>
<artifactId>spray-json_2.11</artifactId>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>io.spray</groupId>
<artifactId>spray-http_2.11</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>io.spray</groupId>
<artifactId>spray-client_2.11</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>com.typesafe</groupId>
<artifactId>config</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-actor_2.11</artifactId>
<version>2.3.9</version>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-slf4j_2.11</artifactId>
<version>2.3.9</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>aopalliance</groupId>
<artifactId>aopalliance</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.jvnet.mimepull</groupId>
<artifactId>mimepull</artifactId>
<version>1.9.4</version>
</dependency>
</dependencies>
dependencies> |
Step 3
Create a sos.ini file and copy your licence key to the file. The file should look like this:
...
Code Block |
---|
language | text |
---|
title | factory.ini |
---|
collapse | true |
---|
|
[spooler]
; enable job history, if set to True the scheduler keeps a job history in database tables
history = yes
; store job protocol for task history (yes|no|gzip, default: no)
history_with_log = gzip
; store job protocol for order history (yes|no|gzip, default: no)
order_history_with_log = gzip
; store protocol for scheduler history (yes|no|gzip, default: no)
history_archive = gzip
; database configuration examples for job history
; active configuration
db = jdbc -class=org.mariadb.jdbc.Driver jdbc:mysql://localhost:3306/scheduler -user=DB_USER -password=DB_USER_PASSWD
db_class = SOSMySQLConnection
; sample configuration for MySQL
;db = jdbc -class=com.mysql.jdbc.Driver jdbc:mysql://localhost:3306/scheduler -user=DB_USER -password=DB_USER_PASSWD
;db_class = SOSMySQLConnection
; sample configuration for MySQL via mariaDB
;db = jdbc -class=org.mariadb.jdbc.Driver jdbc:mysql://localhost:3306/scheduler -user=DB_USER -password=DB_USER_PASSWD
;db_class = SOSMySQLConnection
; sample configuration for Oracle
;db = jdbc -class=oracle.jdbc.driver.OracleDriver jdbc:oracle:thin:@//localhost:1521/scheduler -user=DB_USER -password=DB_USER_PASSWD
;db_class = SOSOracleConnection
; sample configuration for Microsoft SQL Server
;db = jdbc -class=com.microsoft.sqlserver.jdbc.SQLServerDriver jdbc:sqlserver://localhost:1433;sendStringParametersAsUnicode=false;selectMethod=cursor;databaseName=scheduler -user=DB_USER -password=DB_USER_PASSWD
;db_class = SOSMSSQLConnection
; sample configuration for Microsoft SQL Server via jTDS
;db = jdbc -class=net.sourceforge.jtds.jdbc.Driver jdbc:jtds:sqlserver://localhost:1433;sendStringParametersAsUnicode=false;selectMethod=cursor;databaseName=scheduler -user=DB_USER -password=DB_USER_PASSWD
;db_class = SOSMSSQLConnection
; sample configuration for Postgres SQL
;db = jdbc -class=org.postgresql.Driver jdbc:postgresql://localhost:5432/scheduler -user=DB_USER -password=DB_USER_PASSWD
;db_class = SOSPgSQLConnection
; sample configuration for Firebird
;db = jdbc -class=org.firebirdsql.jdbc.FBDriver jdbc:firebirdsql://localhost:3050/scheduler -user=DB_USER -password=DB_USER_PASSWD
;db_class = SOSFbSQLConnection
; sample configuration for DB2
;db = jdbc -class=com.ibm.db2.jcc.DB2Driver jdbc:db2://localhost:50000/scheduler:driverType=2;retrieveMessagesFromServerOnGetMessage=true; -user=DB_USER -password=DB_USER_PASSWD
;db_class = SOSDB2Connection
; sample configuration for Sybase
;db = jdbc -class=com.sybase.jdbc3.jdbc.SybDriver jdbc:sybase:Tds:localhost:5000/scheduler -user=DB_USER -password=DB_USER_PASSWD
;db_class = SOSSybaseConnection
; sample configuration for Sybase via jTDS
;db = jdbc -class=net.sourceforge.jtds.jdbc.Driver jdbc:jtds:sybase://localhost:5000/scheduler -user=DB_USER -password=DB_USER_PASSWD
;db_class = SOSSybaseConnection
; log level (info|debug1|...|debug9, default: info)
log_level = info
; log directory
log_dir = logs
; log filename and log categories (see http://www.sos-berlin.com/doc/en/scheduler.doc/factory_ini_spooler.xml#entry_log)
log = PATH/TO/YOUR/logs/scheduler.log
[java]
class_path = PATH/TO/YOUR/3rdPartyLibraries/*.jar;
; put your Java VM parameters here
options = -Dlog4j.configuration="file:///PATH/TO/YOUR/log4j.properties"
; enable detailed Java debug messages
debug = no |
...
Code Block |
---|
language | powershell |
---|
title | start.cmd |
---|
collapse | true |
---|
|
@echo
set exepath=%~dp0
scheduler.exe -sos.ini="%exepath%sos.ini" -config="%exepath%scheduler.xml" -ini="%exepath%factory.ini" |
Additional configuration
Code Block |
---|
language | text |
---|
title | log4j.properties |
---|
collapse | true |
---|
|
log4j.rootCategory=info, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
log4j.logger.org.hibernate=fatal
log4j.logger.JobScheduler=fatal
log4j.logger.com.sos.scheduler.engine=info
# see http://www.sos-berlin.com/doc/en/scheduler.doc/api/Log-javax.script.xml
log4j.logger.com.sos.scheduler.engine.jobapi.scripting=debug, scheduler
log4j.appender.scheduler=org.apache.log4j.ConsoleAppender
log4j.appender.scheduler.layout=org.apache.log4j.PatternLayout
log4j.appender.scheduler.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n |
Now your folder should contain at least these files (windows-x64-example):
- factory.ini
- jobscheduler-engine.dll
- log4j.properties(optional)
- scheduler.exe
- scheduler.xml
- sos.ini
- start.cmd
Testing the scheduler
Create a folder named "live" in your working directory (your folder). Create a simple hello-world-job in the live-folder.
Code Block |
---|
language | xml |
---|
title | hello world job example |
---|
collapse | true |
---|
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<job >
<script language="shell">
<![CDATA[echo Hello World!]]>
</script>
<run_time once="yes"/>
</job> |
- Open a console in your working directory and start the scheduler with the start.cmd strat script.