Solved

Update record at the end of the day

Posted on 2013-02-04
8
218 Views
Last Modified: 2013-02-06
Hello All;

OK, I figured out my own question, so now, I have this new question, of which I have seen around a few times, here on EE, however, none of the solutions that I can recall, were really that good, unless I missed the good ones.

So.
Question:
I am going to write a script that will calculate my total views across all rows for each day.
Now, HOW (This is the question:) Will I execute the script?

This is going to be Classic ASP.

I was thinking about having a webpage executed from my computer, from a "Scheduled Task", that will load the page, that will then execute the script, and have this done at midnight my time, or the servers time, of which I think is my time as well.
However, what if my internet is down at that time, what will happen then?

Is there a way to have something server-side to execute the script?
Keeping in mind, that I do not have access to the servers, as they are hosted, not personal.

Any idea's on this one?
Thanks All
Carrzkiss
0
Comment
Question by:Wayne Barron
  • 4
  • 3
8 Comments
 
LVL 32

Assisted Solution

by:Big Monty
Big Monty earned 250 total points
ID: 38852670
instead of creating an ASP page to handle this, you're better off creating a vbs file and then creating a scheduled task to execute it, that way if your website loses internet connectivity but still can access the database server, you'd be ok. As I'm sure you know, vb script is very similar in syntax compared to ASP server side coding (assuming you're not using javascript server side :) )

I would create a SCRIPTS folder in your site, since it's hosted, create the vbs file in there, and then configure the scheduled task to point to the vbs file.
0
 
LVL 30

Author Comment

by:Wayne Barron
ID: 38852911
OK, how would the script execute if I am unable to send the trigger from me.
As stated, if the internet goes down on my end, I have no way of sending that trigger.

And yes, I do VB, not JS coding.
0
 
LVL 32

Expert Comment

by:Big Monty
ID: 38852936
if you set it up a scheduled task, then the "trigger" would be whatever you specify the day and/or time to be. above, you mentioned you wanted it to run it at midnight, so just set the schedule to midnight and it'll fire off the script at that time
0
 
LVL 78

Accepted Solution

by:
David Johnson, CD, MVP earned 250 total points
ID: 38853103
You would need more access to the web server than what you have in order for it to be triggered.. Unless in your asp you continually update your page views value and also store the date, so if current date > stored date, update your page views page with this page-views value (which is stored in a sql server or a file on the webserver. reset the page views and set the new date into the sql server/files, you will have to add some locking routine i.e.create a lock file so that when this trigger page is viewed by another user that it doesn't try and run this routine twice...  and once you are finished with your update routine delete the locking file
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 30

Author Comment

by:Wayne Barron
ID: 38853142
@Big_Daddy
I do not have access to the server, so I will be unable to do as you suggested.
As I stated in my original comment, It is a hosted server.

@ve3ofa
It is all database driven, as for the file.
I can make it run for me and me only, so that is not going to be a problem.

I think what I will have to do, is do as I originally thought, and that is to put it as a page, and then run it, and hope that I have internet at that time.
If all else fells, I can check in and see if iPhone4 has a way to schedule something like this, as my son as one. So, time to start making my script.

Have a good one.
Carrzkiss
0
 
LVL 32

Expert Comment

by:Big Monty
ID: 38856435
"I was thinking about having a webpage executed from my computer, from a "Scheduled Task", "

If you have access to create a scheduled task, then you can implement the solution I offered quite easily. Instead of opening a web page, all you'd do is open a vbs file
0
 
LVL 30

Author Comment

by:Wayne Barron
ID: 38856568
the hosting provider, does not have anything like that.
If I had my own server with them, then I could.
Of which is something that I will look into, once I start actually making some money
On these sites, other than what I do make.
0
 
LVL 30

Author Closing Comment

by:Wayne Barron
ID: 38861661
OK Guys.
I created my ASP VB Script, and set a scheduled task for it, for every night at 11:59:30
Last night it went off without an issue, and created the first record.

So, this script will run every night forever.
It will also become a permanent fixture in nearly all my sites as well.

Once I get to where I am hosting in-house, I will do as you suggested Big_Daddy.
However, I am unable to do that right now.

All is good, and this one is completed.

have a great rest of the week.
Carrzkiss
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

What is an ISAPI filter?   •      It's an assembly (.dll file) that can add or change the way IIS works.   •      They can be enabled globally for your web server or on a site-by-site basis.   When the IIS server receives a request, enabling the ISAPI fi…
This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now