kettle执行定时任务,kitchen.bat

本文介绍 Kettle ETL 工具的基本概念及其组成部分 Spoon、Kitchen 和 Pan 的功能。Kettle 是一款用 Java 编写的开源数据抽取、转换、加载工具,支持通过图形界面或命令行进行数据处理任务的配置与执行。文章还提供了使用 kitchen.bat 和 pan.bat 脚本启动作业和转换的具体参数示例。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

环境
操作系统:windows server 2008_x86
etl:kettle6.0

Kettle是一个开源的ETL(Extract-Transform-Load的缩写,即数据抽取、转换、装载的过程)项目,项目名很有意思,水壶。按项目负责人Matt的说法:把各种数据放到一个壶里,然后呢,以一种你希望的格式流出。Kettle包括三大块:

Spoon——转换/工作(transform/job)设计工具 (GUI方式)
Kitchen——工作(job)执行器 (命令行方式)
Span——转换(trasform)执行器 (命令行方式)

Kettle是一款国外开源的etl工具,纯java编写,绿色无需安装,数据抽取高效稳定。Kettle中有两种脚本文件,transformation和job,transformation完成针对数据的基础转换,job则完成整个工作流的控制。

kitchen.bat后面可以是-也可以是/ 然后加上options
Options:
  /rep            : Repository name 资料库名称
  /user           : Repository username 资料库用户名
  /pass           : Repository password 资料库密码
  /job            : The name of the job to launch  job名
  /dir            : The directory (dont forget the leading /) job的目录
  /file           : The filename (Job XML) to launch  xml job的文件名
  /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 列出在特定目录下的job
  /listrep        : List the available repositories 列出可用的档案库
  /norep          : Do not log into the repository 不登陆档案库
  /version        : show the version, revision and build date 查看版本及创建日期
  /param          : Set a named parameter <NAME>=<VALUE>. For example -param:FILE=customers.csv
  /listparam      : List information concerning the defined parameters in the specified job.
  /export         : Exports all linked resources of the specified job. The argument is the name of a ZIP file.
  /custom         : Set a custom plugin specific option as a String value in the job using <NAME>=<Value>, for example: -custom:COLOR=Red
  /maxloglines    : The maximum number of log lines that are kept internally by Kettle. Set to 0 to keep all rows (default)
  /maxlogtimeout  : The maximum age (in minutes) of a log line while being kept internally by Kettle. Set to 0 to keep all rows indefinitely (default)


编写一个test_job.bat 内容如下:
D:
cd D:\Program Files\kettle\data-integration
kitchen.bat -rep kettlerep -user admin -pass admin -dir  /job_dir  -job job_name  -level=basic>D:\JOB_LOG\job_input.log
-rep kettlerep 指定资料档案库名称
-user admin -pass admin 用户名,密码
-dir  /job_dir 指定目录
-job job_name 设置job名称
-level=basic>D:\JOB_LOG\job_input.log设置日志级别及输出路径。

pan.bat 
Options:
  /rep            : 资源库名称
  /user          : 资源库用户名
  /pass          : 资源库密码
  /trans          : 要启动的转换名称
  /dir            : 目录(不要忘了前缀 /)
  /file           : 要启动的文件名(转换所在的 XML 文件)
  /level         : 日志等级 (基本, 详细, 调试, 行级, 错误, 没有)
  /logfile       : 要写入的日志文件
  /listdir        : 列出资源库里的目录
  /listtrans    : 列出指定目录下的转换
  /listrep       : 列出可用资源库
  /exprep      : 将资源库里的所有对象导出到 XML 文件中
  /norep        : 不要将日志写到资源库中
  /safemode       : 安全模式下运行: 有额外的检查
  /version        : 显示版本,校订和构建日期
  /param         : Set a named parameter <NAME>=<VALUE>. For example -param:FOO=bar
  /listparam     : List information concerning the defined named parameters in the specified transformation.
  /metrics        : Gather metrics during execution
  /maxloglines    : The maximum number of log lines that are kept internally by Kettle. Set to 0 to keep all rows (default)
  /maxlogtimeout  : The maximum age (in minutes) of a log line while being kept internally by Kettle. Set to 0 to keep all rows indefinitely (default)

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/28282660/viewspace-2141827/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/28282660/viewspace-2141827/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值