I have an autobackup include file, which backs up every 4 hours, and can be adjustable. very simple to use..copy this to a new asp include file, and include it in the bottom of default.asp:
<%
dim filesys, DB, createdate, Cpath, Npath 'Cpath = current path, Npath = new path
Cpath = server.mappath("admin/database/databasename.mdb")
Npath = server.mappath("admin/database/databasenameBAK.mdb")
createdate=now 'set date so there is not mismatch if file not found
Set filesys = CreateObject("Scripting.FileSystemObject")
if filesys.FileExists(Npath) then
Set DB = filesys.GetFile(Npath)
createdate = DB.DateLastModified
end if
%>
<span class="smtext"><br>
<%
if datevalue(createdate) <> datevalue(now) or NOT filesys.fileExists(Npath) _
OR (datepart("H",now) >= datepart("H", createdate)+4) then
CopyFile Cpath,Npath
response.write "Database backed up -----"
else
response.write "Database backed up on " & createdate & " ... "
end if
%>
</span>
<%
set DB = nothing
set filesys = nothing
function CopyFile(strFileSource, strFileDestination)
dim fso
if strFileSource = "" OR strFileDestination = "" then
'Error - You must supply both a source and a destination
exit function
end if
set fso = Server.CreateObject("Scripting.FileSystemObject")
if Not fso.FileExists(strFileSource) then
'Error - Source file does not exist
set fso = nothing
exit function
end if
'delete destination if it exists
if fso.FileExists(strfiledestination) then fso.deletefile strfiledestination,true
'copy the file
fso.copyfile strFileSource, strFileDestination, true
'clean up
Set fso = nothing
end function
%>
Edited by Stefano