kettle linux部署、执行作业、crontab定时

0.装java1.8

1.解压

pdi-ce-9.2.0.0-290.zip

2.拷贝C:\Users\用户 下的.kettle文件夹到linux 用户home下

3.上传数据库驱动到data-integration/lib下

忘记上传驱动报错:


2021/08/19 20:28:08 - 转换 - ERROR (version 9.2.0.0-290, build 9.2.0.0-290 from 2021-06-02 06.36.08 by buildguy) : Unable to prepare for execution of the tr           ansformation
2021/08/19 20:28:08 - 转换 - ERROR (version 9.2.0.0-290, build 9.2.0.0-290 from 2021-06-02 06.36.08 by buildguy) : org.pentaho.di.core.exception.KettleExcep           tion:
2021/08/19 20:28:08 - 转换 - 无法初始化至少一个步骤.  执行无法开始!
2021/08/19 20:28:08 - 转换 -
2021/08/19 20:28:08 - 转换 -
2021/08/19 20:28:08 - 转换 -    at org.pentaho.di.trans.Trans.prepareExecution(Trans.java:1287)
2021/08/19 20:28:08 - 转换 -    at org.pentaho.di.trans.Trans.execute(Trans.java:756)
2021/08/19 20:28:08 - 转换 -    at org.pentaho.di.job.entries.trans.JobEntryTrans.execute(JobEntryTrans.java:1191)
2021/08/19 20:28:08 - 转换 -    at org.pentaho.di.job.Job.execute(Job.java:693)
2021/08/19 20:28:08 - 转换 -    at org.pentaho.di.job.Job.execute(Job.java:834)
2021/08/19 20:28:08 - 转换 -    at org.pentaho.di.job.Job.execute(Job.java:503)
2021/08/19 20:28:08 - 转换 -    at org.pentaho.di.job.Job.run(Job.java:389)
2021/08/19 20:28:08 - insert-auto_insert_day_01 - 完成作业项[转换] (结果=[false])
2021/08/19 20:28:08 - insert-auto_insert_day_01 - 任务执行完毕

4.执行job

#列出资源库
./kitchen.sh -listrep
#列出资源库下的目录
./kitchen.sh -rep=db-repository -user=admin -pass=admin -listdir
#列出资源库下的job
./kitchen.sh -rep=db-repository -user=admin -pass=admin -listjobs
#列出job的参数
./kitchen.sh -rep=db-repository -user=admin -pass=admin -job=insert-auto_insert_day_01 -dir=/ -listparam
#执行job
./kitchen.sh -rep=db-repository -user=admin -pass=admin -job=insert-auto_insert_day_01 -dir=/ -param:startDay=2021-08-10 -param:endDay=2021-08-10

5.crontab

[gysd@localhost kettle]$ crontab -l
0 5 * * * $HOME/kettle/insert-auto_insert_day_01.sh >$HOME/kettle/insert-auto_insert_day_01.log 2>&1
[gysd@localhost kettle]$ cat $HOME/kettle/insert-auto_insert_day_01.sh
#!/bin/bash
. $HOME/.bash_profile
echo =================`date +%Y-%m-%d~%H:%M:%S`===start

startDay=`date +%Y-%m-%d --date="-6 day"`
endDay=`date +%Y-%m-%d --date="-1 day"`

#startDay='2021-09-01'
#endDay='2021-09-03'

cd $HOME/kettle/data-integration
./kitchen.sh -rep=db-repository -user=admin -pass=admin -job=insert-auto_insert_day_01 -dir=/ -param:startDay=${startDay} -param:endDay=${endDay}


echo =================`date +%Y-%m-%d~%H:%M:%S`===end

[gysd@localhost kettle]$

你可能感兴趣的:(kettle linux部署、执行作业、crontab定时)