关于网站文件自动备份程序的一点思考(3)
Dim bak_dir
bak_dir = bak_root & "\" & now_date & "\"
'2 create backup
Dim fso
Set fso = Server.createobject("Scripting.FileSystemObject")
If Not fso.FolderExists(bak_root) Then fso.CreateFolder(bak_root)
If Not fso.FolderExists(bak_dir) Then fso.CreateFolder(bak_dir)
'response.Write(bak_dir)
If Ubound(files) > Ubound(paths) Then
bak_start = false
Exit Function
End If
Dim i
'On Error Resume Next
For i = 0 To Ubound(files)
'response.Write(sev_root & "\" & paths(i) & files(i))
If fso.FileExists( sev_root & "\" & paths(i) & files(i) ) And Not fso.FileExists(bak_dir & perfix & files(i)) Then
fso.CopyFile sev_root & "\" & paths(i) & files(i) , bak_dir & perfix & files(i)
End If
Next
'3 Delete out of date backup
Dim date_out
date_out = isodate( date - Abs(bak_set("date_out")) )
'response.Write(date_out)
Dim dates
Dim bak_date
bak_date = ""
dates = split(bak_set("bak_date"),"|")
For i = 0 To Ubound(dates)
If dates(i) < date_out Then
'On Error Resume Next
内容版权声明:除非注明,否则皆为本站原创文章。