Wonder if its possible

07/23/2009 10:01 Arcotemple:)#1
To make MySQL make an automatic backup everyday after like say every 30 minutes
then it saves to a certain folder in your comp
can it be done?
07/23/2009 10:14 I<3tanelipe#2
I bet it can. WHY DONT YOU TRY IT!! xD
07/23/2009 10:37 Arcotemple:)#3
lol cuz idk how i would go about trying stuff like that
07/23/2009 13:19 _Emme_#4
Quote:
using System.Runtime.InteropServices;

[DllImport("kernel32.dll")]
static extern int GetShortPathName(string longPath, StringBuilder buffer, int bufferSize);



public void Batch()
{
StringBuilder buffer = new StringBuilder(256);
GetShortPathName(Path.GetDirectoryName(MySqlEXEPat h), buffer, buffer.Capacity);
string shortfilename = buffer.ToString();

string BatchFile = @"c:\temp\Batch.bat";
StreamWriter sw = new StreamWriter(BatchFile);
sw.WriteLine("cd " + shortfilename);
sw.WriteLine(@"mysql -uroot -pXXX DB_NAME < C:\TEMP\FILE.SQL");
sw.Flush();
sw.Close();

//IMPORTANT, DO NOT FORGOT THIS
Environment.CurrentDirectory = @"c:\windows\";

Process.Start(BatchFile);

}
Found the script @ google.
07/23/2009 13:25 Arcotemple:)#5
thanks emme you r 1337!