I am a developer and I am discussing with my sysadmin how to backup the MySQL database we are using.
The previous sysadmin told me he had started backing up the database, but the new guy, who isn't as experienced is offering to help me develop a script.
First of all is it normal that the developer is expected to be responsible for the database backups? Every other place I have worked, the sysadmin has taken care of it, leavening me to do development.
So at the moment I have a Perl script that calls a mysql-dump, and backs it up along with the code. Now for some reason the backups in the middle of the nighht fail, and create a truncated version of the database. I developed this as a temporary solution, and when I needed it a couple of weeks ago, the backup had failed. For this reason I would prefer that the sysadmin takes responsibility, as I have code to develop, and don't need to be checking cron job outputs every day.
So what is a reliable way of backing up the database every hour, and getting a warning if the backup fails.
The typical scenario I have seen is that business owner or his delegate decides on the retention, acceptable dataloss and recovery point objectives as the owner is the one paying the resulting bills.
The DBA (and/or sysadmin) get an idea of the application profile (complex transactions or simple table updates, back-up window, database size, data growth, number of changed rows etc.) and decide on an appriopiate backup strategy to meet those requirements.
At that point the business owner usually decides that the initial platinum backup requirements are too expensive, so rinse and repeat.
Developers don't even get access to production systems and even if they do; they're not responsible for daily backups. (Although it's good practice to ensure you have a back-up before doing any work on the database structure).
So I agree with you, make it somebody elses problem.
If your application normally runs transactions that update multiple tables you'd want to run mysqldump with the table lock options to ensure consistency. But that will block all updates to your database for the duration of the backup job, so doing that every hour is often a Bad Idea.
The binary log allows for point in time restores and incremental backups.
Take a look at http://dev.mysql.com/doc/refman/5.7/en/backup-methods.html
A simple script that makes a back-up of all databases on a MySQL server, each database to an individual file. It will only e-mail you in case of problems. As long as cron runs, the back-ups will be created. As always, also test your restore capabilities!: