开发者

download only from 1am - 8am (ruby)

I have a script running on windows box that downloads files from the net via http. I want it to download only from 1am - 8am (my ISP's off peak time). I am happy if already started download finish开发者_如何学编程es after 8am but what is the best method to make sure that the script starts downloading after 1am? I want to run the script and go to sleep. I want to use ruby only.

Is sleep the best way how to do it?


There is a good article on this here: Scheduling tasks in Ruby / Rails

But as someone else mentioned, you should use the windows task scheduler to start your script. Unless you really want to start it manually at 1am and every time you reboot your windows box... See this other SO question on how to add a scheduled task using the AT DOS command: What is the Windows version of cron?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜