This question How to run an `after-save-hook` only when the buffer has been saved manually provides a way to have after-save hook run after pressing Ctrl-x Ctrl-s, in the answer Here's an alternative solution.
However the hook cannot take a argument. I understand a -function is needed and add-function
is to be used instead.
The argument I wish to pass to the function is the file path of the buffer being saved as I wish to rsync it to a remote compile server.