I want to register hour and date of users in a network after they login, so, to do it, I want to run a script after every login, and it will create a file contain login hour and date.

The problem is: I don't know how to configure pam_script to run this script after every login.
I have to add commands in common-auth file? I'm no certainly.

help, pelase.