Announcement

Collapse
No announcement yet.

Circular Backup

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Circular Backup

    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
    Kirk

    http://cleverhouseautomation.ca
    http://southcoastwebsitedesign.ca

    #2
    As this script is written no. It would take a modification to do so. There are other scripts that allow a destination. One is called Rotating_backups.txt

    http://ubb.homeseer.com/6/ubb.x?a=tp...3&m=9262981305

    -Rupp
    -Rupp
    sigpic

    Comment

    Working...
    X