命令行方式执行kettle的JOB

来源:互联网 发布:淘宝衣服尺码怎么看 编辑:程序博客网 时间:2024/05/18 01:11

kettle中Kitchen是一个作业执行引擎,用来执行作业,这是一个命令行执行JOB的工具。

前提:

配置好JAVA环境变量

打开我的电脑--属性--高级--环境变量 

新建系统变量JAVA_HOME 和CLASSPATH 

变量名:JAVA_HOME 

变量值:C:\Program Files\Java\jdk1.7.0

变量名:CLASSPATH 

变量值:.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;

选择“系统变量”中变量名为“Path”的环境变量,双击该变量,把JDK安装路径中bin目录的绝对路径,添加到Path变量的值中,并使用半角的分号和已有的路径进行分隔。 

变量名:Path 

变量值:%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin


相关详细参数:

  /rep            : Repositoryname 资源库名称

  /user           : Repositoryusername 资源库用户名  

  /pass           : Repositorypassword 资源库密码  

  /job            : Thenameofthejobtolaunch 任务名称

  /dir            : The directory 任务目录 记得开始的/or\

  /file           : The filename 任务XML文件名称  

  /level          : The logging level 指定日志级别(Basic, Detailed,Debug, Rowlevel, Error,Nothing) 

  /logfile        : The logging file to write to 指定日志文件  

  /listdir        : List the directories in the repository 列出指定存储中的目录结构  

  /listjobs       : List the jobs in the specified directory 列出指定目录下的任务列表  

  /listrep        : List the available repositories 列出所有的存储  

  /norep          : Do not log into the repository 不写日志  

  /version        : show the version, revision and builddate 

  /param          : Set a named parameter<NAME>=<VALUE>. For example -param:FOO=bar 

  /listparam      : List information concerning the definedparameters in the specified job. 

  /export         : Exports all linked resources of thespecified job. The argument is the name of a ZIP file. 

  /maxloglines    : The maximum number of log lines that arekept internally by Kettle. Set to 0 to keep all rows (default) 

  /maxlogtimeout  : The maximum age (in minutes) of a log linewhile being kept internally by Kettle. 

                    Set to 0 to keep all rowsindefinitely (default)  



示例:
windows环境下 多个参数用 / 分隔 ,key 和value中间用 : 分隔
     JOB在文件中
kitchen /file:D:/demo/demo.kjb /level:Basic>D:/demo/demo.log
JOB在数据库中
kitchen /rep etl /user admin /pass admin /dir demo /job demo /level Basic /logfile D:/demo/log/demo.log



linux环境下 参数用 - 分隔,key 和value 中间用=号分隔
JOB在文件中
kitchen.sh -file=/home/job/demo.kjb >> /home/job/log/demo.log
JOB在数据库中
kitche.sh -rep=etl -user=admin -pass=admin -level =Basic -job=demo 


   

 

0 0
原创粉丝点击