Well usually it's done through the useradd command. But it's also possible to manually update /etc/passwd with for example vipw.
You could always write a wrapper script for the useradd command which also updates your other file. But that wouldn't include updates which are done through other methods. You could also create a cron script which checks for updates to the /etc/passwd by maybe checking the modified timestamp and then updating your other file accordingly.
Maybe you would like to explain a little more what needs to get updated in the similar file? Is this only a list of names or is this also dependant on other changes in the /etc/passwd file? Like if someone changes their shell.
|