For each main command (X), there is a hook post-Xand pre-X.
However, if the goal is to create a remote backup of the local recipient repository, I would do this in the "changegroup" in the local repository.
When solving this problem in the past, I just installed cron jobs for periodically dragging and dropping from the local state to the backup, which can lag far behind, but does not leave a pushing user waiting to be clicked (hooks are executed in the foreground).
source
share