等同于CRON的工作? [英] Equiv of a CRON job?

查看:83
本文介绍了等同于CRON的工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我开发PHP网站之前,我们已经有了一个名为

CRON作业的服务器工具来设置某个页面在预定义的时间段运行(安排它)


ASP.NET / IIS是否存在等价?我有一些脚本,我可以每天跑步,并且想知道最好的方法吗?

解决方案

< blockquote>你有几个选择。最接近您的问题的是可以执行计划任务的Windows服务。这将需要

在主机上安装服务,这可能是也可能不是
。另一个选择是在Session_OnStart

事件处理程序中包含代码,它会检查日期和时间并在用户开始时运行或不运行任务

会议。


-

HTH,

Kevin Spencer

..Net开发商

微软MVP

大件东西组成

很多小东西。


安德鲁·班克斯 < BA **** @ nojunkblueyonder.co.uk>在消息中写道

新闻:KN ********************* @ news-text.cableinet.net ...

在我们开发PHP网站之前,我们已经有一个名为
CRON作业的服务器工具来设置某个页面在预定义的时间段运行(安排它)
<是否有ASP.NET / IIS的等价?我有一些脚本,我可以每天跑步,并想知道最好的方法吗?



第一个选项似乎更可靠,但我没有那个选项,因为我在一个

共享服务器上。


第二个选项很好但不是可靠。如果没有人访问该网站,则不会启动

会话,因此不会运行任何内容。


有没有人知道其他选择吗?


" Kevin Spencer" < uc*@ftc.gov>在消息中写道

新闻:%2 **************** @ TK2MSFTNGP10.phx.gbl ...

你有几种选择。最接近您的问题的是
是可以执行计划任务的Windows服务。这将需要在主机上安装服务,这可能是也可能不是。另一种方法是在Session_OnStart
事件处理程序中包含代码,该代码检查日期和时间,并在用户会话开始时运行或不运行
任务。

-
HTH,
Kevin Spencer
.Net开发人员
微软MVP
很多东西都是由很多小东西组成的。

安德鲁·班克斯 < BA **** @ nojunkblueyonder.co.uk>在消息中写道
新闻:KN ********************* @ news-text.cableinet.net ...

我之前已经开发了PHP网站之前我们有一个名为
a CRON作业的服务器工具来设置某个页面在预定义的时间段运行(安排

有没有ASP.NET / IIS的等价?我有一些脚本,每天跑步我可以做b $ b,并想知道最好的方法吗?






你可以运行一个计划任务(在IIS / ASP之外);我想这取决于你的剧本。


Scott


" Andrew Banks" < BA **** @ nojunkblueyonder.co.uk>在消息中写道

新闻:KN ********************* @ news-text.cableinet.net ...

在我们开发PHP网站之前,我们已经有一个名为
CRON作业的服务器工具来设置某个页面在预定义的时间段运行(安排它)
<是否有ASP.NET / IIS的等价?我有一些脚本,我可以每天跑步,并想知道最好的方法吗?



When I''ve developed PHP sites before we''ve had a server facility called a
CRON job to set a certain page to run at pre-defined periods (schedule it)

Is there an equvalent for ASP.NET/IIS? I''ve got some scripts which I could
do with running daily and wondered the best way to do this?

解决方案

You have a couple of alternatives. The closest fit to your problem would be
a Windows Service that can perform a scheduled task. That would require
installing the Service on the host machine, which may or may not be
possible. Another alternative is to include code in your Session_OnStart
Event Handler, which checks the date and time and runs or doesn''t run a task
at the beginning of a user''s Session.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Andrew Banks" <ba****@nojunkblueyonder.co.uk> wrote in message
news:KN*********************@news-text.cableinet.net...

When I''ve developed PHP sites before we''ve had a server facility called a
CRON job to set a certain page to run at pre-defined periods (schedule it)

Is there an equvalent for ASP.NET/IIS? I''ve got some scripts which I could
do with running daily and wondered the best way to do this?



First option seems more reliable but I won''t have that option as I''m on a
shared server.

Second option is good but not as reliable. If no one visitis the site, no
sessions are started and hence nothing will be run.

Does anyone know any other alternatives?

"Kevin Spencer" <uc*@ftc.gov> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...

You have a couple of alternatives. The closest fit to your problem would be a Windows Service that can perform a scheduled task. That would require
installing the Service on the host machine, which may or may not be
possible. Another alternative is to include code in your Session_OnStart
Event Handler, which checks the date and time and runs or doesn''t run a task at the beginning of a user''s Session.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Andrew Banks" <ba****@nojunkblueyonder.co.uk> wrote in message
news:KN*********************@news-text.cableinet.net...

When I''ve developed PHP sites before we''ve had a server facility called a CRON job to set a certain page to run at pre-defined periods (schedule it)
Is there an equvalent for ASP.NET/IIS? I''ve got some scripts which I could do with running daily and wondered the best way to do this?





You could just run a scheduled task (outside of IIS/ASP); I guess it depends on your scripts.

Scott

"Andrew Banks" <ba****@nojunkblueyonder.co.uk> wrote in message
news:KN*********************@news-text.cableinet.net...

When I''ve developed PHP sites before we''ve had a server facility called a
CRON job to set a certain page to run at pre-defined periods (schedule it)

Is there an equvalent for ASP.NET/IIS? I''ve got some scripts which I could
do with running daily and wondered the best way to do this?



这篇关于等同于CRON的工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆