Custom IPN Callback/Hook

I need to trigger command line scripts after confirmed payments.
Is there a way to add a custom callback/hook function after the payment confirmation?