Medya Blue

Windows Server Family Developer Center

  • MySQL Backup

    Sunucumuzda kurulu olan MySQl server için yedekleme scripti

    1Mysql Backup

    Backup_Path = "D:\Backup\MySQL\"
    Data_Folder    = "C:\MySQL5\data\"

    dim FSO, NewFolder, NewFolderPath
    set FSO = CreateObject("Scripting.FileSystemObject")
    NewFolderPath = Backup_Path & Get_Date
    If Not FSO.FolderExists(NewFolderPath) Then
        Set NewFolder = FSO.CreateFolder(NewFolderPath)
    End If

    Set klasor = fso.GetFolder(Data_Folder)
    Set say = klasor.SubFolders
    For Each sec in say
        call MySQL5Backup(sec.name)
    Next

    function MySQL5Backup(DataBaseName)
        set fso = CreateObject("Scripting.FileSystemObject")
        set WshShell = Wscript.CreateObject("Wscript.Shell")
        set WshSysEnv = WshShell.Environment("Process")
        mySqlFileName = Backup_Path & Get_Date & "\MySQL5_" & DataBaseName & ".sql"
        ' Veri Tabanı BIN Klasörü konumu farklı ise düzennlenecek, ayrıca ADMIN PASSWORD u girmeyi unutmayınız
        mySqlBackupCommand = "cmd /c C:\MySQL5\bin\mysqldump.exe -u root -pROOT-PASSWORD " & DataBaseName & " > " & mySqlFileName
        WshShell.Run mySqlBackupCommand
    end Function

    Function Get_Date
        Dim tmp
        Dim erg
        tmp = Year(Date)
        erg = CStr(tmp)
        If Month(Date) < 10 Then
        tmp = "0" & Month(Date)
        Else
        tmp = Month(Date)
        End If
        erg = erg & tmp
        If day(Date) < 10 Then
        tmp = "0" & day(Date)
        Else
        tmp = day(Date)
        End If
        erg = erg & tmp
        Get_Date = erg
    End Function

    Yüklemeler
    MySQL Backup
    MySQL Backup VBS
    rar
    Tasarım Deep Design Group
    Copyright ® 2013 MEDYA BLUE