如何模仿Windows服务器上的cron作业? [英] How to emulate cron jobs on a Windows Server?

查看:161
本文介绍了如何模仿Windows服务器上的cron作业?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows中运行.NET和我想有一个函数在午夜运行每一个夜晚。当然,由于HTTP无状态和Windows没有一个cron作业式的功能(我知道),我将不得不每天晚上来访问我的网站我在午夜或只是等待用户访问该网站依靠它被更新。

I'm running .NET on a windows box and I would like to have a function run every night at midnight. Of course since HTTP stateless and Windows doesn't have a "cron job" type function (that I know of), I will either have to visit my site myself every night at midnight or just wait for a user to visit the site to rely on it being updated.

有没有这样的一个替代方案,我可以创造一个东西会自动在特定时间运行?

Is there an alternative to this that I can create where something will automatically run at a certain time?

感谢

推荐答案

如果没有其他答案为你工作,这里有一个选项:

If none of the other answers work for you, here's an option:

有一堆服务器监控服务,在那里,将定期HTTP调用到您的网站(每隔如果你喜欢分钟)。你可以对其中的一些自由间隔5分钟。

There are a bunch of server monitoring services out there that will make an http call to your site at regular intervals (every minute if you like). You can get 5 minute intervals for free on some of them.

创建受保护的页面密码,执行的功能(如果它尚未今天完成),并在其指向该服务。

Create a password protected page, that performs your function (if it hasn't been done yet today) and point that service at it.

至少这样你就不必写什么额外的,你可以高枕无忧它不依赖自己家里的电脑上。

At least this way you won't have to write anything additional, and you can rest easy knowing it doesn't rely on your home machine.

这篇关于如何模仿Windows服务器上的cron作业?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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