标签:bat 资源库 level Windows kettle job JOB 定时
通常情况下,在工作中在数据抽取过程中,会使用到job进行定时抽取。本文主要介绍kettle在windows下定时执行job。
备注:我用的kettle版本是5.1.0
1、准备编写kettle.bat脚本
有库
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
没有库
D: cd D:\kettle\data-integration kitchen.bat -file="D:\tools\Common\kettle_pdi-ce-8.2.0.0-342\data-integration\job_test1.kjb" -level=basic>D:\JOB.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
至此就算完成了操作
标签:bat,资源库,level,Windows,kettle,job,JOB,定时
来源: https://www.cnblogs.com/jijm123/p/16415348.html
本站声明:
1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。