Forum Moderators: open

Message Too Old, No Replies

Calling an ASP page at set times of day

Is there any way to do this?

         

IanTurner

10:44 pm on Jan 20, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



I need to set up a regular email to my supplier giving order details for a perticular day.

Is there anyway I can do this using an ASP page called at a set time of day?

amoore

11:31 pm on Jan 20, 2002 (gmt 0)

10+ Year Member



If you're on a linux/unix machine, you can use cron. It's a tool that will run commands a set time of day. "man crontab", "man 5 crontab", and "man cron" should give you a lot of information about this command. There's also a boatload of online resources about standard unix tools like this.

If I need to pull web pages from cron, I usually use wget or curl, which are command line tools to pull web pages.

Any competent scripter should be able to put together a shell or perl script to pull a web page and show you how to set up a cron job to call it.

IanTurner

12:30 am on Jan 21, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Unfortunately its on an IIS server

ralnikov

9:21 am on Jan 21, 2002 (gmt 0)

10+ Year Member



Better way to do that task is to write WSH script instead of ASP (these scripts are almost the same) and add it to Scheduled tasks. Or get a command-line HTTP downloader (e.g. wget win32 port) and add to scheduled task something near 'wget [192.168.0.1...]

Xoc

11:13 am on Jan 21, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can use the windows scheduler, as ralnakov said. Another hack that could be used if you have a steady stream of visitors and the timing of the report can be less precise:

On a very popular page (or all pages with a SSI), do a check to see if enough time has passed since the last report was sent. If so, then send the report. I wrote about using the CDONTS library to send mail in this [webmasterworld.com] post.

IanTurner

11:34 am on Jan 21, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Xoc, the CDONTS route was the line I was currently taking it was triggering the page that is causing me the problems - in the initial stages the site may not be hit during a day and getting the trigger page to work each day is my worry.

The client will want to see a mail even if they have no orders to process.

Once the site was getting regular hits I can see the method you are proposing working very effectively.

Xoc

12:21 pm on Jan 21, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In that case the Windows Scheduler would be the way to go. If you don't have control over the server, then any machine that is on continuously and has a continuous connection to the internet could issue the request to the page using the technique mentioned in ralnikov's post. This forces a hit on a given page at a particular time.

ralnikov

12:47 pm on Jan 22, 2002 (gmt 0)

10+ Year Member



Xoc, please try to be more accurate. I'm ralnikov, not ralnakov. It's my last name. Thank you.

Xoc

6:28 pm on Jan 22, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



My apologies. I got it right the second time!

ralnikov

10:00 am on Jan 23, 2002 (gmt 0)

10+ Year Member



OK, thank you Xoc :)