catch if db changes/is synchronized

Hey community,
is there any way to run a function if I synchronize Sandbox with Live?
Or is there any other way to run a code after I insert a new entery with Content-manager.

I have a code, that adds some more data to the entry with update().
For now I have a (admin) page with a button that runs the code.

I can’t use something like setInterval(), because I have to update the data immediately and I don’t want to run a code all the time, if I don’t need it.

Check here → RealTime API

Hey,
thanks for your answer, but that isn’t working for me.

I would need a function, that is executed as soon as I press this button.

Or maybe an event listener, that runs my function, if there are made any changes in the Live-dataset.

@nickoertel I don’t think that actions perform on the content manager trigger the data hooks.
Ajit Kumar’s solution is good if you update the database using code.

@jonatandor35 Hey, thanks but this solution doesn’t help in my case.
After the insert/update function, I have to make some changes in the database, before I run my function.