If you are backing up your Alpha desktop app, this may help you automatically get the users out during the time frame the backup is running.
This is a sample of one possible way to notify a user you will be closing your app in x minutes, and what time they will be able to get in again after the backup.
It is very basic using tidbits of code in two form OnTimer events, and the Autoexec script. There is also a couple lines of code on an OK button.
What it does:
1) On opening the app, a form is loaded (hidden) with an OnTimer running every 15 seconds.
2) If the time falls between 09:00 PM and 09:05 PM, a form (ACKNOWLEDGMENT) will open and alert the user that the app will close at 09:05 PM for a backup.
3) If the user clicks the OK button, the message is subdued for the balance of the 5 minutes. If he does not click ok, he's probably not at his desk, and the process continues.
4) At 09:05, the app will close abruptly. (You can give a one minute warning, if you add another form popping up at that time, if you so choose.)
5) If the user tries to open the app between 09:05 PM and 09:15 PM, they are briefly alerted that a backup is underway, and Alpha closes.
You need to adjust the times in the autoexec script, and on the OnTimer events to your own times.
To cut down on milliseconds of overhead, the SHUTDOWN form on timer event has a section that checks to see if it is before 09:00 PM, and if so, the script stops there.
If desired, you can add a little code to detect which computers or users this applies to.
The above will allow backing up files that may otherwise have been in use, but if the user goes in while the backup is running, he may prevent the backup of the shutdown table (not needed, anyway) and the ADB files may not get backed up. This, too, is not an issue unless you are developing the app at that site.
You will need to change your system time to test this, which might mean you need to turn off your clock synchronizing with a time server. Also, Alpha's Internal Licensing doesn't take well to incorrect dates, ao try to test on today's date, only.
Hint:
The best backup will run from the machine that is your data server. Newer Windows versions, in most cases, use a shadow copy to create a backup of a locked file.
This is a sample of one possible way to notify a user you will be closing your app in x minutes, and what time they will be able to get in again after the backup.
It is very basic using tidbits of code in two form OnTimer events, and the Autoexec script. There is also a couple lines of code on an OK button.
What it does:
1) On opening the app, a form is loaded (hidden) with an OnTimer running every 15 seconds.
2) If the time falls between 09:00 PM and 09:05 PM, a form (ACKNOWLEDGMENT) will open and alert the user that the app will close at 09:05 PM for a backup.
3) If the user clicks the OK button, the message is subdued for the balance of the 5 minutes. If he does not click ok, he's probably not at his desk, and the process continues.
4) At 09:05, the app will close abruptly. (You can give a one minute warning, if you add another form popping up at that time, if you so choose.)
5) If the user tries to open the app between 09:05 PM and 09:15 PM, they are briefly alerted that a backup is underway, and Alpha closes.
You need to adjust the times in the autoexec script, and on the OnTimer events to your own times.
To cut down on milliseconds of overhead, the SHUTDOWN form on timer event has a section that checks to see if it is before 09:00 PM, and if so, the script stops there.
If desired, you can add a little code to detect which computers or users this applies to.
The above will allow backing up files that may otherwise have been in use, but if the user goes in while the backup is running, he may prevent the backup of the shutdown table (not needed, anyway) and the ADB files may not get backed up. This, too, is not an issue unless you are developing the app at that site.
You will need to change your system time to test this, which might mean you need to turn off your clock synchronizing with a time server. Also, Alpha's Internal Licensing doesn't take well to incorrect dates, ao try to test on today's date, only.
Hint:
The best backup will run from the machine that is your data server. Newer Windows versions, in most cases, use a shadow copy to create a backup of a locked file.
Comment