Get a list of accounts in the ‘secondary’ home directory (in this example, home3)…
[[email protected] home]# cat /etc/passwd|grep home3|awk -F: ‘{print $1}’ > /root/home3list
Find all symlinks missing from /home…
[[email protected] home]# for user in `cat /root/home3list`; do if [ ! -L /home/$user ]; then echo $user >> /root/missing; fi; done
Add the missing symlinks…
[[email protected] home]# for user in `cat /root/missing`; do ln -s /home3/$user /home/$user; done