0
我有一個包含archiver作業的spring項目,我有時想從命令行手動調用它,有沒有一個選項?有沒有辦法從Linux Shell手動調用Spring Quartz Job
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd">
<bean id="archiverService" class="jobs.service.ArchiverService" />
<bean id="myJob" class="jobs.MyJobs" />
<bean id="archiverJob" class="org.springframework.scheduling.quartz.JobDetailBean">
<property name="jobClass" value="cmd.jobs.Archiver" />
<property name="jobDataAsMap">
<map>
<entry key="myJob" value-ref="myJob" />
</map>
</property>
</bean>
<bean id="cronTriggerArchiverJob" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="archiverJob" />
<property name="cronExpression" value="0 0 23 * * ?" />
</bean>
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="jobDetails">
<list>
<ref bean="archiverJob" />
</list>
</property>
<property name="triggers">
<list>
<ref bean="cronTriggerArchiverJob" />
</list>
</property>
</bean>
</beans>