I want to create a cronjob for making a backup (sql dump) from my database and e-mail it to me. Setting up the cronjob and stuff works great and I’m able to use parts of my zend application 🙂
Unfortunately I cannot use exec() or system() on my server so now I’m looking for a way to get the same result. I searched everywhere with all possible descriptions I could think of, but without any results.
So in short:
- I want to backup my databaseup
- Preferably in .sql format (like export in phpmyadmin)
- Using the Zend framework (so I can use my already loaded
application.ini settings for the database) - I cannot use
exec()orsystem()
I’m completely stuck so really anything would help! Thanks in advance!
The solution by David Walsh looks like what you want:
http://davidwalsh.name/backup-mysql-database-php
A php script that retrieves the tables in a database and saves the data in a .sql file.