Schedule timer to be executed once a month - C#

后端 未结 2 589
故里飘歌
故里飘歌 2021-01-29 01:42

I need to transfer some data from SQL Server to MySQL, once a month. I have already done this transfer stuff, but I don\'t know (and I have not found out on the internet) how to

2条回答
  •  离开以前
    2021-01-29 02:04

    You could use the Windows Task Scheduler for this kind of work. Look here for command line options of Schtasks (there's tons of them)

    Example 1:

    To schedule a task that runs on the first day of every month

    The following command schedules the MyApp program to run on the first day of every month. Because a value of 1 is the default for both the /mo (modifier) parameter and the /d (day) parameter, these parameters are omitted from the command.

    schtasks /create /tn "My App" /tr myapp.exe /sc monthly
    

    Example 2:

    To schedule a task for the 15th day

    The following command schedules the MyApp program to run on 15th of every month at 3:00 P.M. (15:00). It uses the /d parameter to specify the date. It also uses the /st parameter to specify the start time.

    schtasks /create /tn "My App" /tr myapp.exe /sc monthly /d 15 /st 15:00
    

提交回复
热议问题