您的位置:首页 > 科技 > IT业 > Kettle使用命令pan/kitchen执行任务时传参问题

Kettle使用命令pan/kitchen执行任务时传参问题

2024/10/6 0:34:15 来源:https://blog.csdn.net/zidielang/article/details/142023299  浏览:    关键词:Kettle使用命令pan/kitchen执行任务时传参问题

在用windows任务执行kettle的kjb或ktr文件时,可通过bat命令传递参数,测试了很久,特此记录一下。

一、pan\kitchen 参数说明

Options:
/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

二、常规变量的书写格式

options 后面可以是=也可以是:也可以是空格

如:pan /file d:\test.ktr   或者 -file=D:\test.ktr

三、参数变量的特殊格式

window下,一定要用 " " 双引号,多个变量按顺序书写即可(linux下不用引号)

如:pan /file d:\test.ktr "-param:key1=value1" "-param:key2=value2"

四、kjb\ktr参数变量的接收

      一定在任务中定义命名参数,否则参数无法传递成功

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com