標籤:
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 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:\
下面是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
連結:http://www.cnblogs.com/wxjnew/p/3620792.html
(轉)Kettle命令列