06-06-2005, 11:36 AM | #1 (permalink) |
The Original JizzSmacka
|
Automated MySQL backup programs?
Can anyone recommend a free automated server side program that you can schedule a weekly backup of the MySQL database and save it to the server or email?
__________________
Never date anyone who doesn't make your dick hard. |
06-08-2005, 05:29 AM | #4 (permalink) |
Insane
Location: Michigan
|
WinXP, have a scheduled task run a VBS file, and do something like:
Code:
exestring = "c:\mysql\bin\mysqldump.exe --all-databases -u <YOURUSERNAMEHERE> --password=<YOURPWDHERE> -r E:\Backup\MySQL\mysql-backup_" & GetDate() & ".sql" ExecuteString exestring ''''''''''''''''''''''''''''''''''''''''''''''''''' 'ExecuteString: Runs passed string in command shell ''''''''''''''''''''''''''''''''''''''''''''''''''' public sub ExecuteString(exestring) set app = WScript.CreateObject("WScript.Shell") 'WriteDebug ".\debug.txt", exestring 'app.popup exestring app.run exestring, 1, true end sub '''''''''''''''''''''''''''''''''''''''''''''' '/end '''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''' 'Debug: Write passed info to file '''''''''''''''''''''''''''''''''''''''''''''' public sub WriteDebug(lstrFile, lstrTxt) Const ForReading = 1, ForWriting = 2 Dim fso, f Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.OpenTextFile(lstrFile, ForWriting, true) f.WriteLine lstrTxt end sub '''''''''''''''''''''''''''''''''''''''''''''' '/end '''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''''''''''''''''''' 'GetDate: Returns the date in yyyy/mm/dd format ''''''''''''''''''''''''''''''''''''''''''''''' public function GetDate() 'Get the date thedate = datepart("yyyy", now) 'Fill in single month digits with a 0 If len(datepart("m", now)) = 1 Then thedate = thedate & "0" & datepart("m", now) else thedate = thedate & datepart("m", now) End if 'Fill in single date digits with a 0 If len(datepart("d", now)) = 1 Then thedate = thedate & "0" & datepart("d", now) else thedate = thedate & datepart("d", now) End if GetDate = thedate end function '''''''''''''''''''''''''''''''''''''''''''''' '/end '''''''''''''''''''''''''''''''''''''''''''''' I have one for unix (osx, whatever, as long as it supports cron)... Ill see if I can find it, but its similar.. the mysqldump <OPTIONS HERE> is the same, but getting the date is a little different (easier).
__________________
Patterns have a habit of repeating themselves. Last edited by asshopo; 06-08-2005 at 05:42 AM.. |
06-08-2005, 05:40 AM | #5 (permalink) |
Insane
Location: Michigan
|
Something like (call this file backup.sh):
Code:
#!/bin/bash #Get current date TODAY=$(date +%Y%m%d) mysqldump --all-databases -u <YOURUSERNAMEHERE> --password=<YOURPWDHERE> -r /path/to/backup/directory/mysql-backup_$TODAY.sql exit 0 Code:
00 1 * * * <YOURSYSTEMUSERNAMEHERE> /path/to/backup.sh
__________________
Patterns have a habit of repeating themselves. |
Tags |
automated, backup, mysql, programs |
|
|