PDA

View Full Version : how to limit updates to X machines per day?


cydude
03-23-2008, 12:26 AM
I need a way to throttle the update mechanism to X machines per day. Any ideas?

Mark
03-24-2008, 11:02 AM
Hi cydude,

I'm not exactly sure what you mean by "throttle". Perhaps you could explain what you want to do with TrueUpdate in a little bit more detail.

cydude
03-24-2008, 11:07 AM
If we have thousands of machines out there we don't want to update all of them at once. Instead, we want to limit the number of updates performed per day.

tigran
03-24-2008, 01:02 PM
This solution is not easy, but doable.

1. Create a .PHP file (e.g. UPDATECOUNT.PHP) and place it on your server. Every time the file is executed by your TrueUpdate, it will update a counter in SQL / Access database or simply a text file on the server.

2. Create another .PHP file (e.g. CHECKCOUNT.PHP) on your server to read the number of updates from database / text file before performing an update.

The system will work as follows:

1. The user runs TrueUpdate, which in turns calls CHECKCOUNT.PHP on your server and receives a number of updates performed today.

2. If the limit hasn't been reached yet, proceed updating a client. At the end of update, call UPDATECOUNT.PHP on your server to increment today's update count in your server database or text file by 1.

The .php files will be called by your TrueUpdate as follows:
sResult = HTTP.Submit("http://myservername/CHECKCOUNT.PHP", nil, SUBMITWEB_POST, 20, 80, nil, nil);

Depending on your knowledge of IIS and PHP, it should take you around 1 week to figure out php code and IIS security settings for the system to work.