每个特定时间段运行程序的建议

发布于 2024-10-02 08:02:03 字数 188 浏览 4 评论 0原文

有一个程序可以对 SharePoint 中存储的文档进行爬网和索引。我需要每隔一段时间运行一次。我们的一些建议:

  • 将应用程序转移到 Windows 服务中并安排它在每个周期运行。
  • 有一个程序可以在每个时间段触发此应用程序。

您认为这两种方式哪种更有效率。任何其他建议都非常受欢迎。谢谢。

There is a program which crawls and index documents stored in SharePoint. I need to run that every period of time. Some of the suggestions we had:

  • Transfering the application into a windows service and schedualing it to run every period.
  • Having a program that trigger this application every period of time.

Which of the two ways do you consider more efficient. Any other suggestions are pretty welcome. Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

别在捏我脸啦 2024-10-09 08:02:03

使用任务计划程序< Windows 的 /strong>。

Use the Task Scheduler of Windows.

假装不在乎 2024-10-09 08:02:03

如果您的程序足够简单,我将使用 Windows 的任务计划程序定期运行它(您的选项#2)。无需为此编写 Windows 服务。

If your program is simple enough, I would just use Windows' Task Scheduler to run it periodically (your option #2). There is no need to write a windows service for this.

夜清冷一曲。 2024-10-09 08:02:03

您可以使用 DOS“AT”命令来安排任务运行。

The AT command schedules commands and programs to run on a computer at
a specified time and date. The Schedule service must be running to use
the AT command.

AT [\\computername] [ [id] [/DELETE] | /DELETE [/YES]]
AT [\\computername] time [/INTERACTIVE]
    [ /EVERY:date[,...] | /NEXT:date[,...]] "command"

\\computername     Specifies a remote computer. Commands are scheduled on the
                   local computer if this parameter is omitted.
id                 Is an identification number assigned to a scheduled
                   command.
/delete            Cancels a scheduled command. If id is omitted, all the
                   scheduled commands on the computer are canceled.
/yes               Used with cancel all jobs command when no further
                   confirmation is desired.
time               Specifies the time when command is to run.
/interactive       Allows the job to interact with the desktop of the user
                   who is logged on at the time the job runs.
/every:date[,...]  Runs the command on each specified day(s) of the week or
                   month. If date is omitted, the current day of the month
                   is assumed.
/next:date[,...]   Runs the specified command on the next occurrence of the
                   day (for example, next Thursday).  If date is omitted, the
                   current day of the month is assumed.
"command"          Is the Windows NT command, or batch program to be run.

You can use the DOS "AT" command to schedule your task to run.

The AT command schedules commands and programs to run on a computer at
a specified time and date. The Schedule service must be running to use
the AT command.

AT [\\computername] [ [id] [/DELETE] | /DELETE [/YES]]
AT [\\computername] time [/INTERACTIVE]
    [ /EVERY:date[,...] | /NEXT:date[,...]] "command"

\\computername     Specifies a remote computer. Commands are scheduled on the
                   local computer if this parameter is omitted.
id                 Is an identification number assigned to a scheduled
                   command.
/delete            Cancels a scheduled command. If id is omitted, all the
                   scheduled commands on the computer are canceled.
/yes               Used with cancel all jobs command when no further
                   confirmation is desired.
time               Specifies the time when command is to run.
/interactive       Allows the job to interact with the desktop of the user
                   who is logged on at the time the job runs.
/every:date[,...]  Runs the command on each specified day(s) of the week or
                   month. If date is omitted, the current day of the month
                   is assumed.
/next:date[,...]   Runs the specified command on the next occurrence of the
                   day (for example, next Thursday).  If date is omitted, the
                   current day of the month is assumed.
"command"          Is the Windows NT command, or batch program to be run.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文