I am setting up the circular backup script bellow: I am wondering if there is a way of telling it where to save the backup files?
sub main(fname)
Dim FSO, without_extension, i
Set FSO = CreateObject("Scripting.FileSystemObject")
' Log the fact that we're doing this
hs.WriteLog "System","Backing up file " + fname
i = InStrRev(fname,".")
if i = 0 then
without_extension = fname
else
without_extension = left(fname,i-1)
end if
' Rotate backups
If FSO.FileExists(without_extension+".b05") then FSO.DeleteFile without_extension+".b05"
If FSO.FileExists(without_extension+".b04") then FSO.MoveFile without_extension+".b04", without_extension+".b05"
If FSO.FileExists(without_extension+".b03") then FSO.MoveFile without_extension+".b03", without_extension+".b04"
If FSO.FileExists(without_extension+".b02") then FSO.MoveFile without_extension+".b02", without_extension+".b03"
If FSO.FileExists(without_extension+".b01") then FSO.MoveFile without_extension+".b01", without_extension+".b02"
If FSO.FileExists(fname) then FSO.CopyFile fname, without_extension+".b01"
end sub
sub main(fname)
Dim FSO, without_extension, i
Set FSO = CreateObject("Scripting.FileSystemObject")
' Log the fact that we're doing this
hs.WriteLog "System","Backing up file " + fname
i = InStrRev(fname,".")
if i = 0 then
without_extension = fname
else
without_extension = left(fname,i-1)
end if
' Rotate backups
If FSO.FileExists(without_extension+".b05") then FSO.DeleteFile without_extension+".b05"
If FSO.FileExists(without_extension+".b04") then FSO.MoveFile without_extension+".b04", without_extension+".b05"
If FSO.FileExists(without_extension+".b03") then FSO.MoveFile without_extension+".b03", without_extension+".b04"
If FSO.FileExists(without_extension+".b02") then FSO.MoveFile without_extension+".b02", without_extension+".b03"
If FSO.FileExists(without_extension+".b01") then FSO.MoveFile without_extension+".b01", without_extension+".b02"
If FSO.FileExists(fname) then FSO.CopyFile fname, without_extension+".b01"
end sub
Comment