I'm wondering how can I backup mysql daily and backup binary log hourly?
I don't know how to write a script to do this(or use etc/crontab?).
I typically add a gzip in there to save space:
The add-drop-tables will automatically drop tables when you restore, otherwise you'd get errors that the tables already exist when restoring.
Have a look at automysqlbackup which takes daily, weekly and monthly backups of your MySQL databases using mysqldump. It also rotates the daily and weekly backups.
I cannot see a reason to take hourly backups of binary log. Better store it on redundant disks if you are worried about head crashes.
Have you looked into mysqldump? It's part of the distribution.
Enter the following:
where databasename is the database to dump and nameofdumpfile should be the whole hierarchy to your desired dumpfile.
The above will dump at midnight daily but you'll want to add qualifiers to suit you.