PK

ADDRLIN : /HMFS2/WEB/DTC038/v0071350.ferozo.com/public_html/administrador/includes/
FLL :
Current File : //HMFS2/WEB/DTC038/v0071350.ferozo.com/public_html/administrador/includes/backup.asp

<%dim fso,f,fc,fn(50),ft(50),fd(50),f1,nbkp,bkppath,s,cant

dim mm, dd

mm = cstr(month(date()))
if len(mm) = 1 then mm = "0" & mm

dd = cstr(day(date()))
if len(dd) = 1 then dd = "0" & dd

nbkp = year(date()) & "_" & mm & "_" & dd & ".mdb"
bkppath = virtualdir & "\backups\" & nbkp

Set fso = CreateObject("Scripting.FileSystemObject")
if not fso.FileExists(bkppath) then
	fso.CopyFile dbpath, bkppath
end if
set fso=nothing

'------------- deja los ultimos 5

bkppath = virtualdir & "\backups"

Set fso = CreateObject("Scripting.FileSystemObject")
if fso.FolderExists(bkppath) then
	Set f = fso.GetFolder(bkppath)
	Set fc = f.Files
	s=0
	 For Each f1 in fc
		fn(s)=f1.name
		ft(s)=f1.size
		fd(s)=f1.datecreated%>
		<%s=s+1
	 next
	 cant=s-1
	 
	 if cant > 9 then
	 	for a = 0 to cant - 9

		Set f = fso.GetFile(virtualdir & "\backups\" & fn(a))
		f.delete
		set f = nothing
	 		
	 	next
	 end if
	 
end if%>


PK 99