0

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 finishes 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?

Radek
  • 14,395
  • 48
  • 147
  • 231

1 Answers1

1

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?

Community
  • 1
  • 1
Etienne Savard
  • 4,553
  • 6
  • 29
  • 45