Linux下用命令来执行kettle文件资源库的文件ktr与kjb的方法
1. 准备工作
一个简单的job,一个简单的trans。
trans:读取download目录下的所有文件名,输出为文件。【界面情况下测试成功】
成功生成目标文件:
job:创建文件。【界面模式测试执行成功】
执行结果:
把界面执行测试结果文件删除,以免影响观察。
2. linux环境以命令行方式执行job和trans
Pan是用于执行trans的PDI命令行工具。
Kitchen是用于执行作业的PDI命令行工具。
- 1
- 2
a. Pan的命令行选项和语法
语法:
pan.sh -option=value arg1 arg2
- 1
命令行参数:
| Switch | Purpose |
|---|---|
| rep | Enterprise or database repository name, if you are using one |
| user | Repository username |
| pass | Repository password |
| trans | The name of the transformation (as it appears in the repository) to launch |
| dir | The repository directory that contains the transformation, including the leading slash |
| file | If you are calling a local KTR file, this is the filename, including the path if it is not in the local directory |
| level | The logging level (Basic, Detailed, Debug, Rowlevel, Error, Nothing) |
| logfile | A local filename to write log output to |
| listdir | Lists the directories in the specified repository |
| listtrans | Lists the transformations in the specified repository directory |
| listrep | Lists the available repositories |
| exprep | Exports all repository objects to one XML file |
| norep | Prevents Pan from logging into a repository. If you have set the KETTLE_REPOSITORY, KETTLE_USER, and KETTLE_PASSWORD environment variables, then this option will enable you to prevent Pan from logging into the specified repository, assuming you would like to execute a local KTR file instead. |
| safemode | Runs in safe mode, which enables extra checking |
| version | Shows the version, revision, and build date |
| param | Set a named parameter in a name=value format. For example: -param:FOO=bar |
| listparam | List information about the defined named parameters in the specified transformation. |
| maxloglines | The maximum number of log lines that are kept internally by PDI. Set to 0 to keep all rows (default) |
| maxlogtimeout | The maximum age (in minutes) of a log line while being kept internally by PDI. Set to 0 to keep all rows indefinitely (default) |
示例:
sh pan.sh -rep=initech_pdi_repo -user=pgibbons -pass=lumburghsux -trans=TPS_reports_2011
- 1
本地trans调用示例:
./pan.sh -file=/home/hadoop/workplace/kettle/trans/test_cml.ktr -norep
- 1
b.Kitchen的命令行参数及语法:
语法与Pan一样,参数有点不同。
| Switch | urpose |
|---|---|
| rep | Enterprise or database repository name, if you are using one |
| user | Repository username |
| pass Repository | password |
| job | The name of the job (as it appears in the repository) to launch |
| dir | The repository directory that contains the job, including the leading slash |
| file | If you are calling a local KJB file, this is the filename, including the path if it is not in the local directory |
| level | The logging level (Basic, Detailed, Debug, Rowlevel, Error, Nothing) |
| logfile | A local filename to write log output to |
| listdir | Lists the sub-directories within the specified repository directory |
| listjob | Lists the jobs in the specified repository directory |
| listrep | Lists the available repositories |
| export | Exports all linked resources of the specified job. The argument is the name of a ZIP file. |
| norep | Prevents Kitchen from logging into a repository. If you have set the KETTLE_REPOSITORY, KETTLE_USER, and KETTLE_PASSWORD environment variables, then this option will enable you to prevent Kitchen from logging into the specified repository, assuming you would like to execute a local KTR file instead. |
| version | Shows the version, revision, and build date |
| param | Set a named parameter in a name=value format. For example: -param:FOO=bar |
| listparam | List information about the defined named parameters in the specified job. |
| maxloglines | The maximum number of log lines that are kept internally by PDI. Set to 0 to keep all rows (default) |
| maxlogtimeout | The maximum age (in minutes) of a log line while being kept internally by PDI. Set to 0 to keep all rows indefinitely (default) |
执行本地job的命令行语句:
/home/kettle/data-integration/kitchen.sh -file=/home/kettle/transition/move.kjb -log=log.log
- 1
形式:
$kitchen路径 -file=$job路径 log=$log路径
- 1
调用pan结果:
调用kitchen结果:
3.个人常用命令选项
由于我当前的工作环境都是执行本地的job和trans文件,所以常用的命令选项有:
| 命令 | 描述 |
|---|---|
| -file | job或trans文件路径 |
| -norep | 标明不是资源库里的文件 |
| -param | 参数设置 |
| -logfile | log输出文件名 |
| -level | log级别 (Basic, Detailed, Debug, Rowlevel, Error, Nothing) |
Linux下用命令来执行kettle文件资源库的文件ktr与kjb的方法的更多相关文章
- linux下rm命令删除文件名中包含特殊字符的文件【转】
转自:http://blog.itpub.net/143526/viewspace-1060083/ 1. 删除带“-”的文件名的方法 2. 删除包含其它特殊字符的文件 3. 删除系统打不出的乱码文件 ...
- Linux下pecl命令无法执行的解决
pecl install swoole 提示如下错误:bash: pecl: command not found执行yum install php-pear生效
- linux下svn命令使用大全
最近经常使用svn进行代码管理,这些命令老是记不住,得经常上网查,终于找了一个linux下svn命令使用大全:1.将文件checkout到本地目录 svn checkout path(path是服务器 ...
- [转载]linux下svn命令使用大全
原文地址:http://blog.chinaunix.net/uid-22150747-id-189264.html 最近经常使用svn进行代码管理,这些命令老是记不住,得经常上网查,终于找了一个li ...
- Linux下scp命令使用
linux下scp命令主要是用来远程拷贝文件,下面介绍两种使用方法 1,拷贝本机文件到远程文件 举例子:把我本地的change目录下的changeFile.txt上传到远程192.168.2.88的k ...
- LINUX学习笔记——LINUX下EXP命令全库备份数据库文件
LINUX下EXP命令全库备份数据库文件 1)建立备份目录,目录操作权限授权给Oracle用户 mkdir /backup --创建backup文件夹 cd / --进入cd语句 ls -l ...
- Linux下的命令,删除文件夹下的所有文件,而不删除文件夹本身
Linux下的命令,删除文件夹下的所有文件,而不删除文件夹本身 rm -rf *
- 在Linux下使用命令行打印文件
近期需要将数学笔记打印出来复习,才发现Linux KDE环境下的默认PDF软件Okular根本无法将我在GoodNotes B5大小的页面写下的内容自适应地放大到A4纸上,只能以页面的原始尺寸打印.然 ...
- 例解 Linux 下 Make 命令
Linux 下 make 命令是系统管理员和程序员用的最频繁的命令之一.管理员用它通过命令行来编译和安装很多开源的工具,程序员用它来管理他们大型复杂的项目编译问题.本文我们将用一些实例来讨论 make ...
随机推荐
- Jar hell问题以及解放方法
当一个类或一个资源文件存在多个jar中,就好存在jar hell问题 可以通过以下代码来诊断问题:
- windows powershell学习
PowerShell,从名字可以知道,他首先是一个shell,shell的意思就是和Linux的bash等一样.和原来的cmd一样就是在里边敲命令(可执行文件)使用: 而Power就意味他是一个功能强 ...
- 阿里云EDAS功能简介
尊敬的 EDAS 用户: 您好!为了给您带来更好的服务和使用体验,EDAS 产品团队将对 EDAS 标准版(含按量付费和包年包月)进行一轮调整,包括按量付费标准版价格和免费额度的更新,以及标准版套餐的 ...
- Kotlin介绍
Kotlin介绍 转 https://www.jianshu.com/p/d30406daaf25 Google在今年的IO大会上宣布,将Android开发的官方语言更换为Kotlin,作为跟着Goo ...
- C++类成员存储大小
1.对象分布图 2.解析 每个类的大小只有其成员变量大小,其中包括:类成员属性,虚函数指针: 而其他没有如:静态变量[静态区],普通函数.静态函数[代码区] 3.总结 类对象的sizeof只包含成员变 ...
- 删除SQL约束的方法
在SQL数据库中,如果需要删除表约束,应该如何操作呢?下面就将为您介绍删除SQL表约束的方法,供您参考,希望对您有所帮助. --1)禁止所有表约束的SQL select 'alter table '+ ...
- swift 日历的制作
制作日历步骤 1.日期数据的处理,这个可以 添加 extension 解决 extension NSDate{ /*几年几月 这个月的多少天*/ class func getDaysInMonth( ...
- Intellij IDEA 打包jar的多种方式
IDEA打包jar包的多种方式 用IDEA自带的打包形式 用Maven插件maven-shade-plugin打包 用Maven插件maven-assembly-plugin打包 1.view-> ...
- mysql子查询用法
mysql子查询用法 1 可以当值来用<pre>select id from hcyuyin_share where id=(select id from hcyuyin_share li ...
- 在 FR 网络配置 OSPF
一.环境准备 1. 软件:GNS3 2. 路由:c7200 二.实验操作 实验要求: 1.掌握配置帧中继的基本方法. 2.掌握在路由器中模拟帧中继交换机的方法. 3.掌握 NBMA 网络中 OSPF ...