Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a requirement for doing Incremental backup of MySQL database. For which I'm writing a shell script using the concept of binary logs.

Now, the scenario is such that a full-backup will happen every alternate day and Incremental backup should be done in between. Suppose full-backup happens on Monday and Wednesday, incremental backup should happen on Tuesday. For point in time recovery, I'm using mysqlbinlog --starttime --stoptime binary-logs > backup.sql In the shell script I need to use starttime and log position of the previous full-backup to specify the log files in the statement, how can I retrieve this in a shell script and record the changes done during that time. Is there anyway I can do this, please help me in this regard.

share|improve this question
add comment

1 Answer 1

You can use Xtrabackup utility for mysql incremental backup they have shell script also you have to modify script according to your need.

share|improve this answer
    
I honestly can't recommend it enough to just learn xtrabackup vs writing it on your own –  kormoc Feb 15 '13 at 6:42
    
I'm interested in a shell script, can anyone help me. –  Rudra Feb 15 '13 at 7:07
    
From here you can check Shell Script gist.github.com/abhishekamralkar/4149641 –  Abhishek Anand Amralkar Feb 15 '13 at 7:09
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.