Re: [PHP-DB] MySQL backup software

2004-10-28 Thread Leo G. Divinagracia III

Perry, Matthew (Fire Marshal's Office) wrote:
Does anyone know a free MySQL backup program to schedule regular backups?

mysql has the ADMINISTRATOR, well at least for win32...
does timed backups.
--
Leo G. Divinagracia III
[EMAIL PROTECTED]
z
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] MySQL backup software

2004-10-27 Thread Luis Morales
Perry, Matthew (Fire Marshal's Office) wrote:
Does anyone know a free MySQL backup program to schedule regular backups?
 

Hi Mathew, i made an litle script to do that.
mysqlbk.pl
Desc: This script made and mysql rotative backup fron sunday to sunday
-
#!/usr/bin/env perl
use strict;
use File::Find ();
use POSIX qw(strftime);
use DBI;
my $day = strftime "%A", gmtime;
my $str = POSIX::strftime( "%A, %B %d, %Y", localtime(time));
my $path = "/home/lmorales/backup/mysql/".$day;
#print "Creando directorio ".$path."\n";
eval{
system("/bin/rm -r ".$path);
system("/bin/mkdir ".$path);
};
my $dbh = DBI->connect("DBI:mysql:database=mysql;host=localhost",
   "root", "yourpasswd",
   {'RaiseError' => 1});
my $sth = $dbh->prepare("show databases");
$sth->execute();
print "Respaldo diario: $str\n";
while (my $ref = $sth->fetchrow_hashref()){
 print "Creando Respaldo para Data Base :  $ref->{'Database'} \n";
 system("/usr/bin/mysqldump -uroot -pag10nus --lock-tables 
$ref->{'Database'} > ".$path."/$ref->{'Database'}.sql");
 system("/usr/bin/bzip2 -9 ".$path."/$ref->{'Database'}.sql");
}

$sth->finish();
$dbh->disconnect();
---
backup-db.sh
you can send script notification using:
#!/usr/bin/env sh
(
echo "To: Luis Morales <[EMAIL PROTECTED]>"
echo "From: system <[EMAIL PROTECTED]>"
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/home/lmorales/bin:
export PATH
echo "Subject: Respaldo diario de la BD::delahorro.com"
echo
/home/lmorales/bin/backup-db.pl
echo
) 2>&1 | /usr/lib/sendmail -t
exit 0
---
and finally add this entry to crontab:
0 1 * * * /backup-db.sh &> /dev/null
Good luck..!
regards,
Luis Morales
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP-DB] MySQL backup software

2004-10-27 Thread Norland, Martin
You were on the right track with mysqldump.  Windows doesn't have a
direct cron equivalent - but it does have the ability to schedule tasks.
Write a short batch file or equivalent (you should be able to whip one
together in no time with a little googling) and schedule it to run.

I doubt you'll find a tool that does exactly what you want that's any
more advanced or configurable - there's just no need.  That said - who
knows, people make all kinds of software to fill what others perceive as
unneeded.

Cheers,
- Martin Norland, Database / Web Developer, International Outreach x3257
The opinion(s) contained within this email do not necessarily represent
those of St. Jude Children's Research Hospital.


-Original Message-
From: Perry, Matthew (Fire Marshal's Office)
[mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 27, 2004 8:58 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] MySQL backup software


Does anyone know a free MySQL backup program to schedule regular
backups?

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] MySQL backup software

2004-10-27 Thread Jason Wong
On Wednesday 27 October 2004 13:57, Perry, Matthew (Fire Marshal's Office) 
wrote:
> Does anyone know a free MySQL backup program to schedule regular backups?

  www.mysql.com

  google > mysql mailing list

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
Sigh.  I like to think it's just the Linux people who want to be on
the "leading edge" so bad they walk right off the precipice.
(Craig E. Groeschel)
*/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] MySQL backup software

2004-10-27 Thread Perry, Matthew (Fire Marshal's Office)
Does anyone know a free MySQL backup program to schedule regular backups?