Chinaunix首页 | 论坛 | 博客
  • 博客访问: 344092
  • 博文数量: 10
  • 博客积分: 5067
  • 博客等级: 大校
  • 技术积分: 1105
  • 用 户 组: 普通用户
  • 注册时间: 2006-02-06 14:39
文章分类

全部博文(10)

文章存档

2012年(1)

2009年(4)

2008年(5)

我的朋友

分类: Java

2009-02-26 10:23:21

Job Scheduler 学习笔记

一、安装

1、本文采用的是scheduler_win32.1.3.5,下载地址

2、数据库采用的是oracle10g,首先建立个用户如jobschedule

3、安装时注意选择oracle,输入正确的oracle连接即可。

4、测试

二、使用说明

1、使用job schedule editor创建hot folder element ->job,然后将job存放到installpath/config/live下。(这种job不用重启job schedule server即可)

2、另外一种方法是编辑installpath/config/scheduler.xml文件。

三、例子

1 Automatic Scheduled Execution of a Shell Script

 

This example job for the my_shell_script script is configured as follows:

 

    * for an automatic start every 30 minutes (the job will be run 1800 seconds after the previous run has been completed), weekdays between 9 and 12 o'clock

    * and for manual starts between 8:00 & 20:00 every day.

    * The job starts the ./jobs/my_shell_script.sh shell script.

    * Note that the scheduling can be combined with directory monitoring. This is described in Example 2 below.

 

 

The job is added to the ./config/scheduler.xml configuration file in the form of a job element as follows:

 

                                  

 

 

   

     

       

     

     

        ...

     

     

       

              = "jobs/my_shell_script.sh"

          

                    param  = "">

          

          

                       end = "20:00">

            

              

                       

              

              

                       

              

              

                       

              

              

                       

              

              

                       

              

            

           

       

     

   

 

 

2Program Execution

 

In this example a MySQL database Windows Service will be restarted at 4:00 am by way of two jobs.

 

    * The first service_stop job stops and the second service_start job starts the Windows service.

      The Windows own net.exe program is used for both jobs.

      This program lies in a sub-directory of the Windows system32 directory. The Windows %windir% enviroment variable can be used for this path.

      Note that enviroment variables can also be designated on Windows systems using "$".

    * The MySQL database service name is "MySQL". Additionally, jobs cannot be manually started.

    * Note also that in this example it would actually be better to use a shell script, in order to catch errors.

 

 

The job is added to the ./config/scheduler.xml configuration file in the form of a job element as follows:

 

                                  

 

 

   

     

       

     

     

        ...

     

     

       

              = "$windir\system32\net.exe"

                    param  = "stop MySQL">

          

          

            

          

       

       

              = "$windir\system32\net.exe"

                    param  = "start MySQL">

          

          

            

          

       

     

   

 

阅读(1697) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~