Hello Carlwill
You might need to do something different if the user may have files outside /home/<username> (ignoring transient files that will be removed anyway, such as files in /tmp).
If there is a possibility that the user may be re-instated it is better to disable than to delete. That way you reserve both their user name and user ID. This can be done, for example, by replacing their login shell in /etc/passwd with /dev/null. If you take this advice there is no need to add their /etc/passwd and /etc/shadow records to the tarball.
Thank you for prettying the script with a fixed pitch font; you can also use the # icon to format text as CODE.
Performance is not an issue -- unless you are deleting thousands of users?!
Critiquing the script ...
Safer (and easy) to get the users' home directory by ~<username> rather than assume it's /home/<username>.
It would be safer to examine the return code from tar (check the value of $?) before removing the home directory.
If the
[ -d /home/$USERNAME ] test fails it would be helpful to have an
else clause giving an error message.
There may be other places that user-specific data is kept; the only one I can bring to mind is the samba password database.
Best
Charles