kettle linux调用

脚本:


#!/bin/bash
last_date=`date +%Y%m%d --date="1 day ago"`
kettle_home=/opt/kettle/pdi-ce-7.1.0.0-12/data-integration
repo=PRD
user_name=admin
passwd=admin
dir=/DATA_CHECK
job=check_done_send_mail
log=/home/kettlelog/${job}_${last_date}.log

${kettle_home}/kitchen.sh  -rep ${repo}  -user ${user_name} -pass ${passwd} -dir ${dir} -job ${job} -level=debug >> ${log}
~                                      

一下摘自https://www.jianshu.com/p/33efeb73543f

/rep        : repository name
/user       : repository username
/pass       : repository password
/job        : the name of the job to launch
/dir        : the directory (dont forget the leading /)
/file       : the filename (job xml) to launch
/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 build date
/param      : set a named parameter <name>=<value>. for example -param:foo=bar
/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.

而options 后面可以是=也可以是:也可以是空格
kitchen.bat /file d:\ 或者 -file=d:\ 或者/file:d:\等等都可以

pan.sh 运行参数基本与kitchen.bat相同
运行转化 的参数:

-trans
### 如何在 Kettle 中配置和调用外部应用程序或 API #### 使用 Shell 脚本执行外部程序 对于 Unix/Linux 或 macOS 用户来说,在 Kettle (Pentaho Data Integration, PDI) 中可以通过 "Execute a process" 这一步骤来运行 shell 命令或者脚本来启动任何外部应用。这允许灵活地集成各种命令行工具和服务。 ```bash #!/bin/bash # Example of calling an external application via command line. /path/to/application --option value ``` 此方法适用于那些能够通过命令行接口操作的应用程序[^1]。 #### Java 类转换器用于复杂逻辑处理 当需要更复杂的交互时,比如直接与 Java 应用通信,则可以利用 “Modified Java Script Value” 变换或是编写自定义插件的方式实现更为深入的功能扩展。这种方式适合于有编程背景的技术人员使用,并能充分利用Java的强大功能来进行数据处理和业务逻辑编码[^2]。 #### REST Client 插件访问 Web APIs 针对现代基于 HTTP/HTTPS 协议的服务端口,特别是RESTful风格Web服务,Kettle提供了专门的组件叫做 `Rest Client` 。它可以直接发送GET、POST请求给目标服务器地址,并接收返回的结果作为下一步变换输入源之一。设置URL参数、头部信息以及认证机制都是可行的支持选项[^3]。 ```json { "method": "GET", "url": "https://api.example.com/data", "headers": { "Authorization": "Bearer YOUR_ACCESS_TOKEN" } } ``` 以上三种途径为Kettle用户提供了多种可能性去连接不同的系统和技术栈,无论是传统的还是新兴起的各种平台都可以找到合适的接入方案[^4]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值