Quartz.net创建windows服务

序言

安装服务

sc create XXService binpath= "XXService.exe"  start= auto
sc description XXService "XX服务" 
sc start XXService
pause

卸载服务

sc stop XXService
sc delete XXService
pause

 

<?xml version="1.0" encoding="UTF-8"?>

 

<!-- This file contains job definitions in schema version 2.0 format -->

<job-scheduling-data xmlns="http://quartznet.sourceforge.net/JobSchedulingData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0">

 

  <processing-directives>

    <overwrite-existing-data>true</overwrite-existing-data>

  </processing-directives>

 

  <schedule>

    <!--该作业用于定时更新商品库存-->

    <job>

      <name>UpdateInventoryJob</name>

      <group>Update</group>

      <description>定时更新商品库存</description>

      <job-type>TopshelfAndQuartz.UpdateInventoryJob,TopshelfAndQuartz</job-type>

      <durable>true</durable>

      <recover>false</recover>

    </job>

    <trigger>

      <cron>

        <name>UpdateInventoryTrigger</name>

        <group>Update</group>

        <job-name>UpdateInventoryJob</job-name>

        <job-group>Update</job-group>

        <start-time>2017-12-01T00:00:00+08:00</start-time>

        <cron-expression>0 0/1 * * * ?</cron-expression>

      </cron>

    </trigger>

  </schedule>

 

</job-scheduling-data>

 

 

 

资料

Quartz.NET 配置文件详解

https://www.cnblogs.com/asxinyu/p/dotnet_Opensource_project_CronNET.html

https://www.cnblogs.com/jsenke/p/5545635.html

https://www.cnblogs.com/qk2014/p/4869675.html

转载于:https://www.cnblogs.com/cnki/p/9545455.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值