I’m not sure if this is possible using regular hosting plans like those from GoDaddy/Razor Hosting/DiscountASP/etc., or if I’ll need a VPS (or similar).
What I’m trying to do is to either have a program run constantly and perform an activity every hour or have the program start every hour. The program/service basically uses HttpWebRequest to get a web page’s source and saves it to a SQL Server database. Obviously I want it to run every x number of minutes to keep the content up-to-date. I may use the program 7 times a day or I may use it every 7 months, so it can’t crawl a site every time the page is visited.
On my own machine, I’d create an ASP.Net page with a thread or backgroundservice that checks the time for an hourly interval and then performs the task. But since I’m on another machine that I have very limited access, I don’t know how to go about this. I was thinking maybe a SQL Server trigger would worked, perhaps off of system time, but I’m not sure if this would work (I’d be executing a program?).
There are lots of other ways to perform this task on my machine, but I can’t do any of them b/c I don’t have access to the actual system with regular hosting. So do I have to get a VPS [or something similar] or is there any way I can do this?
You won’t be able to run programs/software on standard hosting plans. You will need either a VPS or Dedicated Hosting. Dedicated Hosting is preferred as some VPS plans, depending on host, still won’t even allow it.
However you could do something similar with PHP, or any web language, and then have it run as a Cron Job, which is allowed on normal hosting. Basically if you can code it into what would be a front-end page or small script (perl/python etc),then you can code it and have it run as Cron. So for example code the page, place in directory /crons then like the Cron Job to it, but just don’t like anywhere else in site to it.