kettle使用命令行來運行ktr和kjb

1:cmd方式運行

1.ktr的運行:運行transformation文件是通過Pan.bat來運行的。

打開cmd命令行窗口,轉到Pan.bat所在的目錄,如d:\data-integration,然後執行文件的命令爲:pan /file D:\etltest\EtltestTrans.ktr

2.kjb的運行:運行job文件是通過kitchen.bat來運行的。

打開cmd命令行窗口,轉到Pan.bat所在的目錄,如d:\data-integration,然後執行文件的命令爲:kitchen /file D:\etltest\jobOK.kjb

2.bat文件運行

如果覺得通過打開命令行輸入麻煩,我們可以把它寫在一個批處理文件中。如:

d:

cd D:\data-integration

pan /file D:\etltest\EtltestTrans.ktr

把這些內容保存在pan.bat裏,通過雙擊panKtr.bat就可以執行ktr文件了。

同樣地,我們把下面的內容:

d:

cd D:\data-integration

kitchen /file D:\etltest\jobOK.kjb

保存在kitchenKjb.bat裏,雙擊它,也可以執行kjb文件。

2 :kettle 的 kitchen.bat 後面參數說明

Options:
/rep        : Repository name
/user       : Repository username
/pass       : Repository password
/job        : The name of the job to launch
/dir        : The directory (dont forget theleading /)
/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 thespecified job.
/export     : Exports all linked resources of the specifiedjob. The argument is the name of a ZIP
file.


而options 後面可以是=也可以是:也可以是空格

kitchen.bat /file d:\   或者 -file=D:\ 或者/file:D:\

下面是windows系統下一個完整的執行kettle程序的 bat 批處理文件的內容

======================================

e:

cd E:\Tools\data-integration
Kitchen.bat -rep repname -user admin -pass admin -dir /dirname -job jobname -level=basic>D:\kettlelog\kettlelog.log

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章