Welcome Guest, Not a member yet? Register   Sign In
MySQL Backup Script in CI
#5

[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
tar cfz /var/local/backups/mysql-$date.tgz  /var/lib/mysql
/etc/init.d/mysql start

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.


Messages In This Thread
MySQL Backup Script in CI - by El Forum - 03-16-2009, 12:04 PM
MySQL Backup Script in CI - by El Forum - 03-16-2009, 12:08 PM
MySQL Backup Script in CI - by El Forum - 03-16-2009, 12:11 PM
MySQL Backup Script in CI - by El Forum - 03-16-2009, 12:12 PM
MySQL Backup Script in CI - by El Forum - 03-16-2009, 12:45 PM



Theme © iAndrew 2016 - Forum software by © MyBB