3

I work just on ASP classic (I know I've to learn something new, but for now...) and that's my problem:

In my database I store website's account. After a year the accounts needs to be deactivated. I've create a function that's works fine, but I need a sheduled call (every night at 00.00 am). Is it possibile? Do I need to put the call on global.asa?

thanks a lot!

Maurizio

zeno2k
  • 193
  • 1
  • 8

3 Answers3

2

If you have access to the server, create a vbscript (.vbs) and setup the Task Scheduler...

This is what we use for database tidy routines and for nightly backups.

JezB
  • 528
  • 1
  • 10
  • 26
  • Tnx for your answer, by the way I've no access on the iis configuration beacause my website is stored on a public server and not on a dedicated one :( – zeno2k Jul 19 '12 at 13:54
  • The only thing I can think of is to schedule a call to an asp page from another machine. I don't believe there's any way to schedule a tasks without full access to the server... – JezB Jul 19 '12 at 14:02
  • I cannot wait the user login procedure, beacause I need to send him an email in advance, and it's not sure that user do login every day. – zeno2k Jul 19 '12 at 14:07
2

You can schedule jobs through free cron services such as https://www.setcronjob.com with configuration like in following picture. This is a good solution for hosting customers who do not have permission to create the task, I used many times with no trouble. The service will request to url you specified at you specified timespan or exact time.
For a little bit security / avoiding unnecessary requests you could specify a custom hash for the will be requested page.

If Request.QueryString("hash") = "somespecialstuffs" Then
    'Do Job
End If

enter image description here

Kul-Tigin
  • 16,728
  • 1
  • 35
  • 64
0

if you don't have access to the servers, as a work-around you can do the following... Create a task in your server (anything that runs 24 hours), and that task will just visit your site to a specific ASP page with a parameter that instructs it to do the update, so create an ASP file that reads the parameter and runs the update.

The problem with putting it in global.asa is that, if your site is not constantly in use, IIS could stop the application process after some time (think the default in IIS is like 30 minutes), so you're not guaranteed that the application process will be up to run the update.

Rodolfo
  • 4,155
  • 23
  • 38