SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Addict
    Join Date
    Aug 1999
    Posts
    218
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have a CGI program in which I need to schedule a cgi script to execute on a periodic basis. With UNIX, you use the cron utility (daemon?) but I'm on NT/IIS. I would assume the same thing could also be accomplished using the AT command under NT. I'm also confused about the syntax though. Would you just put the command into a batch file and schedule the batch file to run?

  2. #2
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    A batch file??? We back in the days of DOS?

    Use WSH (Windows Scripting Host) for all your scripting needs. Check out this article: http://www.4guysfromrolla.com/webtech/101399-1.shtml

    You can also schedule ASP scripts to run at certain times and have them trigger your PERL script. Check out: http://www.4guysfromrolla.com/webtech/101399-1.shtml



    ------------------
    Wayne Luke - Sitepoint Moderator/Internet Media Developer
    Digital Magician Studios - Making Magic with Web Applications
    wluke@digitalmagician.com

  3. #3
    SitePoint Addict
    Join Date
    Aug 1999
    Posts
    218
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm just looking for something short and simple that would kick off a cgi file every 10 minutes. The links, while great resources, seem a little bit more than what I'm looking for.

    Is there a simpler way to do this?

  4. #4
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Yeah throw it in Windows Task Scheduler. It should be in the tray next to your clock.

    ------------------
    Wayne Luke - Sitepoint Moderator/Internet Media Developer
    Digital Magician Studios - Making Magic with Web Applications
    wluke@digitalmagician.com

  5. #5
    SitePoint Addict
    Join Date
    Aug 1999
    Posts
    218
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The issue here is not that I don't know how to schedule but rather that I don't know what to schedule. There's a file with a .cgi extension that needs to be run but I'm not sure of the syntax. Simply putting the path to the file doesn't seem to work.

  6. #6
    SitePoint Enthusiast
    Join Date
    Feb 2000
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here's how I do it:

    Use scheduler to kick off *.bat file.

    .bat file consists of:

    cd Inetpub/wwwroot/cgi-bin/
    filename.pl

    Don't know if the extension has anything to do with it?

    Good luck.

    Mark

  7. #7
    SitePoint Addict
    Join Date
    Aug 1999
    Posts
    218
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here's my issue (I think). When I use a similar batch file, the .cgi file simply opens up in Notepad. When I look in Explorer it is indeed associated with Notepad. I tried associating the file with Perl but that hosed up the whole app. What should the .cgi extension be associated with to allow it to execute?

  8. #8
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Change the extension to .pl, which is the newe standard for PERL anyways. Then ActivePerl will execute it when it is run just as if it was a Word doc or a text file.

    You change file associations on the View Menu in Explorer.. View -> Options or Folder Options -> File Types.

    ------------------
    Wayne Luke - Sitepoint Moderator/Internet Media Developer
    Digital Magician Studios - Making Magic with Web Applications
    wluke@digitalmagician.com


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •