![]() | Backup |
For added security I myself put cookie protection in the backup.asp and in the page which calls it. So you need to login and set a session cookie to make a backup. For the information below I removed this added security, because it would go beyond the backup-issue.
<a href="BACKUP.ASP" onclick="return confirm('Replace backup edited on <% Dim objFSO Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Dim objFolder Set objFolder = objFSO.GetFolder("ABSOLUTE PATH OF BACKUP FOLDER") TotalSize=0 TotalNr=0 For each objItem in objFolder.Files If objItem.Name="DATABASE FILENAME" then response.write FormatDateTime((objItem.DateLastModified), vbShortDate) Next Set objFolder = Nothing Set objFile = Nothing Set objFSO = Nothing %> with current database edited on <% Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objFolder = objFSO.GetFolder("ABSOLUTE PATH OF DATABASE FOLDER") TotalSize=0 TotalNr=0 For each objItem in objFolder.Files If objItem.Name="DATABASE FILENAME" then response.write FormatDateTime((objItem.DateLastModified), vbShortDate) Next Set objFolder = Nothing Set objFile = Nothing Set objFSO = Nothing %>?');">Backup</a> wiki database (current backup dd. <% Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objFolder = objFSO.GetFolder("ABSOLUTE PATH OF BACKUP FOLDER\") TotalSize=0 TotalNr=0 For each objItem in objFolder.Files If objItem.Name="DATABASE BACKUP NAME" then response.write FormatDateTime((objItem.DateLastModified), vbShortDate) Next Set objFolder = Nothing Set objFile = Nothing Set objFSO = Nothing %>).
<% dim StrFileSource, StrFileDestination StrFileSource="ABSOLUTE PATH OF DATABASE" StrFileDestination="ABSOLUTE PATH OF BACKUP" set fso = Server.CreateObject("Scripting.FileSystemObject") Set f2 = fso.GetFile(strFileSource) f2.Copy(strFileDestination) Set f2 = nothing Set fso = nothing %>
~ Daniel 06/06/2005
Thanks very much Daniel for that tip. I will look at it