Linux crontab command Add Kettle Job scheduled task

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.