Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Excerpt
hiddentrue

Execute Jobs in Batch Mode

Index



Kitchen? ?????

Anchor
Kitchen? ?????
Kitchen? ?????

Kitchen? Spoon?? ????? XML???? ?????? ???? ??? Job? ?? ? ? ?? ???? ???. ?????, Job? ?????? ???? ????? ?? ????? ???????.

??

Anchor
??
??

?? Sun Microsystems Java Runtime Environment 1.5 ?? ??? ???. ???? ??http://www.java.com/ ??? JRE? ?? ?? ? ????.

...

Code Block
cd Kettle
chmod +x *.sh



Kitchen ????

Anchor
Kitchen ????
Kitchen ????

?? ????? Carte? ???? ?? ???? ?????? ????.

...

Kitchen Java Runtime Environment ?? 1.5 ??? ?? ?? ??, ?? ?????? ?? ? ? ????.

??? ?? ??

Anchor
??? ?? ??
??? ?? ??

?? ? ? ?? ??? ?? ?? ???.
These are the command line options that you can use.

...

Code Block
/option:value

??? ??? ??? ???.

?? ??

Code Block
-version

? ??? Kettle? ?? ?????(kettle.kar)? ??? ?????.
???? ??? ?? ??? ?? ?????.

XML ?? ??

Code Block
--file=XML????

? ??? XML ??? ??? Job? ?????. (.kjb : Kettle Job)

???? ??

Code Block
-log=???? ??

????? ?? ???. ???? ?? ??(stdout) ???.

???? ??

Code Block
-level=????

????? ???? Job? ????? ?? ???.
????? ??? ??? ??? ????:

  • Error: ??? ???.
  • Nothing: ?? ??? ?? ??.
  • Minimal: ???? ??? ???.
  • Basic: ??? ????.
  • Detailed: ??? ????.
  • Debug: ??? ???? ?? ??? ??.
  • Rowlevel: (row)? ??. ? ??? ?? ???? ?? ? ? ????.

??? ??

Code Block
-rep=?????

?? ?? ??? ??? ?? ???? ?? ???.
??, -user, -pass, -dir ? -job ??? ??? ??? ???.
???? KETTLE_REPOSITORY ? ? ??? ?? ? ?? ????.

??? ??? ?? ??

Code Block
-user=?????

??? ???? ??? ???? ??? ?? ???.
??, ???? KETTLE_USER ? ? ??? ?? ? ?? ????.

??? ???? ??

Code Block
-pass=????

???? ?????? ???? ????.
???? KETTLE_PASSWORD ? ? ??? ?? ? ?? ????.

?? ? ??? Job? ??

Code Block
-job=Job??

?? ? Job? ????? ???? ?? ? ??? ?????. "-dir" ???? ????? ?? ? ???.

???? ???? ???

Code Block
-listdir=Y

"-dir" ???? ?? ? ????? ????? ?? ?? ???? ???? ?????.

??? ???? ??

Code Block
-dir=????

?? ? ???? ????? ?????. ??? ????? ??? ?? ?????.

...

2.2.2 ?? , ?? ????? / (?)? ????? ?????.

??? Job ??? ??

Code Block
-listjobs=Y

"-dir" ???? ??? ??? ????? ?? ?? Job ???? ?????.

??? ??? ??

Code Block
-listrep=Y

??? ?? ??? ???? ?????.

??? ??? ??

Code Block
-norep=Y

???? KETTLE_REPOSITORY, KETTLE_USER, KETTLE_PASSWORD ? ?? ????, Kitchen? ???? ??? ?? ?? ?? ? ????.
?? ??, XML ??? Job? ????? ? ?, ? ??? ?? ? ? ?? ????.



??

Anchor
??
??

Please make sure that you are positioned in the Kettle directory before running the samples below. If you put these scripts into a batch file or shell script, simply do a change directory to the installation directory:

...

Code Block
cd /product/Kettle/



??? ?? Job ?? ??

Anchor
??? ?? Job ?? ??
??? ?? Job ?? ??

This example runs a job from file on a windows platform:

...

Code Block
kitchen.sh -file=/PRD/updateWarehouse.kjb -level=Minimal



?????? ?? Job ????

Anchor
?????? ?? Job ????
?????? ?? Job ????

This example runs a job from the repository on a windows platform:
(Enter on a single line without returns...)

Code Block
kitchen.bat
                    /rep:"Production Repository"
                    /job:"Update dimensions"
                    /dir:/Dimensions
                    /user:matt
                    /pass:somepassword123
                    /level:Basic



?? ??? ??

Anchor
?? ??? ??
?? ??? ??

If you don't want the output of the file to appear on the screen but rather be put into a log file, you can use redirection.

...

Code Block
kitchen.bat /file:C:\PRD\runAll.kjb /level:Basic > C:\LOG\trans.log



????

Anchor
????
????

Kitchen returns an error code based on how the execution went:

  • 0 : The job ran without a problem.
  • 1 : Errors occurred during processing
  • 2 : An unexpected error occurred during loading / running of the job
  • 7 : The job couldn't be loaded from XML or the Repository
  • 8 : Error loading steps or plugins (error in loading one of the plugins mostly)
  • 9 : Command line usage printing



????

Anchor
????
????

Schedule a job on windows

The best way to go at it is to test the command first at the dos prompt.
Then you can use the windows scheduler to launch this command.
Windows versions since Windows 2000 have a GUI for doing this accessible through the control panel. However it's also possible to use the command line to do this:

...

To see a list of the scheduled commands simply type:

Code Block
at

Schedule a job on Unix

First create a shell script that runs all the jobs you need. Then you can schedule this script to run.
On Unix like systems the easiest way to schedule a command is by using the "cron table". You can do this by entering the following command:

...