Excerpt |
---|
|
Execute Jobs in Batch Mode |
Index
Kitchen? ?????
Anchor |
---|
| Kitchen? ????? |
---|
| Kitchen? ????? |
---|
|
Kitchen? Spoon?? ????? XML???? ?????? ???? ??? Job? ?? ? ? ?? ???? ???. ?????, Job? ?????? ???? ????? ?? ????? ???????.
??
?? 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 ??? ?? ?? ??, ?? ?????? ?? ? ? ????.
??? ?? ??
?? ? ? ?? ??? ?? ?? ???.
These are the command line options that you can use.
...
??? ??? ??? ???.
?? ??
? ??? Kettle? ?? ?????(kettle.kar)? ??? ?????.
???? ??? ?? ??? ?? ?????.
XML ?? ??
Code Block |
---|
--file=XML????
|
? ??? XML ??? ??? Job? ?????. (.kjb : Kettle Job)
???? ??
????? ?? ???. ???? ?? ??(stdout) ???.
???? ??
????? ???? Job? ????? ?? ???.
????? ??? ??? ??? ????:
- Error: ??? ???.
- Nothing: ?? ??? ?? ??.
- Minimal: ???? ??? ???.
- Basic: ??? ????.
- Detailed: ??? ????.
- Debug: ??? ???? ?? ??? ??.
- Rowlevel: (row)? ??. ? ??? ?? ???? ?? ? ? ????.
??? ??
?? ?? ??? ??? ?? ???? ?? ???.
??, -user, -pass, -dir ? -job ??? ??? ??? ???.
???? KETTLE_REPOSITORY ? ? ??? ?? ? ?? ????.
??? ??? ?? ??
??? ???? ??? ???? ??? ?? ???.
??, ???? KETTLE_USER ? ? ??? ?? ? ?? ????.
??? ???? ??
???? ?????? ???? ????.
???? KETTLE_PASSWORD ? ? ??? ?? ? ?? ????.
?? ? ??? Job? ??
?? ? Job? ????? ???? ?? ? ??? ?????. "-dir" ???? ????? ?? ? ???.
???? ???? ???
"-dir" ???? ?? ? ????? ????? ?? ?? ???? ???? ?????.
??? ???? ??
?? ? ???? ????? ?????. ??? ????? ??? ?? ?????.
...
2.2.2 ?? , ?? ????? / (?)? ????? ?????.
??? Job ??? ??
"-dir" ???? ??? ??? ????? ?? ?? Job ???? ?????.
??? ??? ??
??? ?? ??? ???? ?????.
??? ??? ??
???? KETTLE_REPOSITORY, KETTLE_USER, KETTLE_PASSWORD ? ?? ????, Kitchen? ???? ??? ?? ?? ?? ? ????.
?? ??, XML ??? Job? ????? ? ?, ? ??? ?? ? ? ?? ????.
??
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
|
?? ??? ??
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
|
????
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
????
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:
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:
...