![]() |
MySQL Backup Script in CI - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: MySQL Backup Script in CI (/showthread.php?tid=16776) |
MySQL Backup Script in CI - El Forum - 03-16-2009 [eluser]deanpcmad[/eluser] Hi, I'm new to CI and was wondering if I could make a MySQL backup script that can backup multiple databases. Any help appreciated. Thanks! MySQL Backup Script in CI - El Forum - 03-16-2009 [eluser]jedd[/eluser] Hi Dean, and welcome to the forums. Are you set on doing this in CI (and if so, why?). I'd recommend you look at doing this kind of thing outside - say a cron job and some CMD or bash scripts to do hotbackups, or take the DB offline and do a dump (preferred - much faster). MySQL Backup Script in CI - El Forum - 03-16-2009 [eluser]deanpcmad[/eluser] "take the DB offline and do a dump (preferred - much faster)." How would I do that? Is there a guide on how to? MySQL Backup Script in CI - El Forum - 03-16-2009 [eluser]deanpcmad[/eluser] I'm looking to make a PHP script that I can run as a CRON MySQL Backup Script in CI - El Forum - 03-16-2009 [eluser]jedd[/eluser] [quote author="deanpcmad" date="1237245091"]"take the DB offline and do a dump (preferred - much faster)." How would I do that? Is there a guide on how to?[/quote] Depends on your system. On mine (a real OS) I run this kind of script from cron: Code: /etc/init.d/mysql stop I have a snippet somewhere to give me $date in a format I like (ISO8601). If you can't take your DB offline for backing up then there are other MySQL utilities for pulling data out of a live system, but if you've got that kind of requirement you probably wouldn't be asking how to do such a thing on a CI forum. Oh .. and you really do not want to do backups, via cron, written in PHP, of your database. Trust me. |