Auto fsck -y at boot

Does anyone know how or if its possible to automatically run fsck -y at boot if the initial fsck check finds that there has been data lost. Usually the initial fsck check will fix low level inconsistencies but if it finds that data has been lost it will put you into single user mode for you to log in as root and run fsck -y manually to repair the file system. Have certain locations that may lose power due to storms and will only run on UPS for a certain length of time, if this occurs at night lets say there is no one present to properly shut down the system. Was wanting to automate this if possible so when they fired the system back on in the morning it would automatically repair itself if it did find a problem. Any help would be appreciated. Thanks in advance.

fsck at boot is set in the /etc/vfstab file?

Enable UFS logging, that would prevent most filesystem corruption situations.

at Solaris 10 UFS logging ist default enabled

I guess the OP isn't using Solaris 10.
Latest Solaris 10 releases support ZFS boot. No fsck is ever necessary with it.

Some of the systems we have problems with are Solaris 9 and we don't want to upgrade them to 10. So your saying that in Solaris 10 we should never have to do a manual fsck -y to repair the file system?

On Solaris 9, I'm suggesting to enable UFS logging which should dramatically reduce the cases where a fsck is required after a power off situation.
With Solaris 10 and newer + ZFS boot, there is no more need to fsck. Actually fsck isn't even available as the file system is always consistent by design.