I also use the BACKUP ON INTERVAL to back up my database, and use a batch file to delete backups older than 7 days, triggered only by my own 'admin' logon. It's not perfect but it works for me.
This is my application programming:
var nn as Int
var vTemp as Int
If @UserID <> "Admin"
{
CloseCommandArea(1)
DisableMenubarItem("&File")
DisableMenubarItem("&Save")
DisableMenubarItem("&Edit")
DisableMenubarItem("&Macro")
DisableMenubarItem("&Help")
DisableMenubarItem("&Quick Start Menu")
DisableMenubarItem("&New Application...")
DisableMenubarItem("&Open Application...")
DisableMenubarItem("&View")
nn = @RedirectProcess("cmd /C del /Q C:\Sesame2\*.htm","")
}
Else // Admin is opening.
{
nn = @ASynchShell("P:\Sesame2\Utilities\cleanup.bat")
// nn = @ASynchShell("c:\sesame2\HTMLcleanup.bat")
nn = @RedirectProcess("cmd /C del /Q C:\Sesame2\*.htm","")
}
// Historical QA Database uses @AppSaveMode = be sure that we can now save again.
AppSaveMode(0)
The First ASynchShell command calls 'cleanup.bat' from the server. So this runs only when I open the application, because I'm not fazed by a black cmd window popping up on me everytime I open Sesame.
Here are the contents of the .BAT file.
:: cleanup.bat
:: This file cleans up the server's sesame2 directory, removing outdated files.
:: The command below will change the attributes of any files that should be deleted.
attrib p:\sesame2\acesystem2\acesystem2*.* -r
:: The command below will delete any file that matches AceSystem2*.* and is older than 7 days.
p:\sesame2\utilities\forfiles -pp:\sesame2\acesystem2 -mAceSystem2*.* -d-7 -c"CMD /C DEL /Q @FILE"
:: The ping command below forces the batch file to pause for 10 seconds. (10,000 milliseconds.)
::PING 1.1.1.1 -n 1 -w 10000 >NUL
I use a little program call 'forfiles' that handles this, which is placed in the same directory as the BAT file. The command that's being called will delete files older than 7 days, so that the server isn't being slowly filled by backup files. The syntax for 'forfiles' took some tweaking and experimentation until I got it just right, but it can be googled.
Others, I'm sure, have a more elegant solution, but this is working for me. Hope it helps.