1. Ensure that the job $KETTLE _HOME/KITCHEN.SH-FILE=/DATA1/TESTDATA/TESTKJB.KJB or converted $KETTLE _home/pan.sh-file=/data1/testdata/ TESTKTR.KTR can perform normally under Linux
This step is configured correctly in the JDK (Ps. Optional configuration of the kettle environment variable, primarily the home directory where the locator is located, without having to refer to the absolute path each time),
There are few other issues where the current user has execute permission for the corresponding *.sh file.
2. Write the execron.sh script that executes the kettle job or transformation, especially in the Red Callout section, in the shell script to perform the operation to refresh the current system environment variables,
The current environment variable is not read because the crontab command executes the script
#!/bin/bash
Source/etc/profile
# $KETTLE _HOME/PAN.SH-FILE=/DATA1/TESTDATA/TESTKTR.KTR
$KETTLE _HOME/KITCHEN.SH-FILE=/DATA1/TESTDATA/TESTKJB.KJB
3. Crontab-e into the scheduled task edit file, the command format is shown below:
# Example of Job definition:
#.----------------Minute (0-59)
# | .-------------Hour (0-23)
# | | .----------Day of Month (1-31)
# | | | .-------month (1-12) OR jan,feb,mar,apr ...
# | | | | .----Day of Week (0-6) (sunday=0 or 7) or Sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * * user-name command to be executed
Time-sharing Weekly command
The 1th column represents minutes 1~59 per minute with * or */1
The 2nd column represents the hour 1~23 (0 means 0 points)
The 3rd column represents the date 1~31
The 4th column represents the month 1~12
5th Column Identification Number Week 0~6 (0 = Sunday)
6th List of commands to run
Example: Execron.sh is performed once a day 7:50
7 * * */data1/testdata/execron.sh
For detailed command explanation, please refer to the Baidu Encyclopedia:
crontab Command _ Baidu Encyclopedia
Linux crontab command Add Kettle Job scheduled task