List:MySQL on Win32« Previous MessageNext Message »
From:Marcel Forget Date:October 6 2005 12:13am
Subject:Re: backup
View as plain text  
You can use %date% to retrieve the date so "dump_%date%.sql" would yield
today dump_2005-10-05.sql

One caveat, make sure you change your short date format to yyyy-MM-dd to
make this work.

Marcel

jbonnett@stripped wrote:

>I backup a MySQL database like this.
>
>I run a Windows batch file that contains
>
>C:\cygwin\bin\bash expdump.sh
>
>The file expdump.sh contains
>
>/cygdrive/C/Program\ Files/MySQL/MySQL\ Server\ 5.0/bin/mysqldump.exe -a
> -h<host> --opt -u<user> -p<password> -P3306 -rpedump.sql
> <database>
>/cygdrive/C/Util/pkzip -a expdump$(/cygdrive/C/cygwin/bin/date +%G%m%d).zip
> pedump.sql
>/cygdrive/C/cygwin/bin/rm pedump.sql
>
>You will need to change the things in <> to match your settings.
>
>I am actually running bash from cygwin just so I can create a file name with the date
> embedded in it. I could not find a simple way to do that in Windows.
>
>The important bit is running mysqldump.
>
>mysqldump.exe -a -h<host> --opt -u<user> -p<password> -P3306
> -rpedump.sql <database>
>
>Pkzip just makes the dump file much smaller so that I can keep several backups. 
>
>John B.
>
>-----Original Message-----
>From: Matías Castilla [mailto:matias.castilla@stripped] 
>Sent: Thursday, 6 October 2005 5:19 AM
>To: MySQL-Win32
>Subject: backup
>
>Do you know where could I find info about mysqlbackup script to run it in a
>Win2000 server?
>matías
>
>
>
>  
>
Thread
Fw: backupJorge Bastos5 Oct
  • RE: backupMatías Castilla5 Oct
RE: backupjbonnett6 Oct
  • Re: backupMarcel Forget6 Oct