windows定時執行kettle的job

參考文檔:http://blog.csdn.net/huangqiude/article/details/47172339

1、準備編寫kettle.bat腳本

(1)資源庫的形式啓動JOB

      腳本內容如下:
      D:
      cd D:\kettle\data-integration

      kitchen.bat -rep JS_JOB -user admin -pass qdhuang -dir  /FTP抽取入庫  -job jobname  -level=basic>D:\JOB_LOG\JOB.log

(2)文件形式

F:
cd F:/download/software/kettle/data-integration
kitchen.bat /norep  -file=E:/temp/buildProject.kjb >>E:/etl.log

2、針對以上我來介紹下
       首先cd 是進入到kettle安裝執行文件目錄下 
       -rep 表示的是你的倉庫名,也就是你的資源庫的名稱,這裏我的資源庫名稱就是 JS_JOB
       -user 資源庫用戶名    這裏就是admin
      -pass 資源庫密碼        這裏是qdhuang 默認的是admin ,爲了安全我們可以更改密碼
      -dir    就是你的job在資源庫中存放目錄  支持中文的目錄
      -job   job的名稱   這裏我的job名稱就是jobname
      -level 日誌的級別  我們普通的寫basic就可以了,就是最基本的
      最後面就是日誌了,針對job跑起來的相關信息都會保存在job.log中
3、針對相關的更多參數如下:
/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.
4、windows下建立執行任務

本次操作的是在windowsserver2008下


然後一步一步創建,下一步就可以了


下一步(選擇你的.bat執行文件)


下一步(選擇job的執行頻率)



輸入本服務器的密碼:必須輸入纔可以執行job


至此就算完成了操作


發佈了6 篇原創文章 · 獲贊 8 · 訪問量 7萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章