Solved

Update record at the end of the day

Posted on 2013-02-04
8
224 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 33

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 33

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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 80

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
 
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 33

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

809 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