You are here
Ronan0 - Tue, 2018/03/06 - 12:15
I have TKLBAM backing up a MySQL database once a day.
But I also use MySQL binary logs to enable recovery of database transactions made since the last tklbam backup occurred.
I would like to be able to automatically delete the previous day's binary log files once TKLBAM has confirmed a successful backup has occurred.
How might I do that?
In the tklbam-backup file in etc/cron.daily after 'tklbam-backup --quiet' is run, is there a way to pickup the confirmation that tklbam has successfully finished its operation, so that on that signal I can proceed to delete the now obsolete MySQL binary log files?
Any input appreciated. Thanks.
Forum:
Sounds like you need a TKLBAM hook script! :)
You'll find the doc page here.
Essentially, you need to write a script (which goes in /etc/tklbam/hooks.d) which accepts 2 arguments an "operation" ('backup'/'restore') and a "state" ('pre'/'post').
There is an example hook: /etc/tklbam/hooks.d/example
I suggest that you enable that ('chmod +x /etc/tklbam/hooks.d/example') and have a bit of a play.
Add new comment