windows定时任务调度kettle作业

关于kettle的介绍太多了,这里不多废话。

windows下定时任务执行kettle Job_安丶随的博客-CSDN博客

我的是 version7.1

如上图,在kettle里面的作业已经执行成功。

一、首先编写bat脚本:(kitchen.bat  后面可以是-也可以是/然后再加options,而options 后面可以是=也可以是:也可以是空格

 D:
cd D:\kettle\pdi-ce-7.1.0.0-12\data-integration
kitchen.bat -rep=product -user=admin -pass=admin -dir=/ -job=人才生产线job -level=basic>D:\kettle\JOB.log

顺便解释一下:

1、首先cd 是进入到kettle安装执行文件目录下 
       -rep 表示仓库名,也就是你的资源库的名称,我的资源库名称就是 product
       -user 资源库用户名    这里就是admin
      -pass 资源库密码        默认是admin ,为了安全我们可以更改密码
      -dir    就是你的job在资源库中存放目录  支持中文的目录
      -job   job的名称   这里我的job名称就是:人才生产线job(job名字不要带后缀,不然提示找不到job错误)
      -level 日志的级别  我们普通的写basic就可以了,就是最基本的
      最后面就是日志了,针对job跑起来的相关信息都会保存在job.log中
2、针对相关的更多参数如下(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.

注意:

保存kitchen.bat文件时,刚开始选的编码是utf8,此时中文乱码(后改为Unicode也是乱码),最后改为ANSI就可以了。

二、完成bat脚本以后,双击测试一下,会跳出cmd命令窗口,此时打开JOB.log日志记录,会发现已经在执行作业了,等待完成以后,cmd窗口会自动关闭。接下来就是Windows的定时任务来管理调度bat脚本了。

三、windows下建立执行任务(我的服务器是Windows Server 2016 Datacenter)

打开控制面板--管理工具--任务计划程序

打开右侧的创建基本任务,填写作业名称,然后下一步打开触发器:

打开触发器,根据自己的需求选择执行频率,然后下一步打开具体的设置:

打开操作,下一步打开具体设置(选择需要执行的bat脚本),下一步完成:

至此,Windows计划任务调度kettle作业完成。

  • 14
    点赞
  • 95
    收藏
    觉得还不错? 一键收藏
  • 10
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 10
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值