Need to exclude .NFSxxx files in clear old files batch script

I am new to Shell Scripting and need some help.

The following batch job has been failing for me due to the .nfsxxx files in use. I need to know how to modify the following script to exclude the .nfsxxx files so this batch job will not fail on me. I have done lots of googling and keep coming back to the lsof command and that is not working for me, Here is the script:

find . -mtime +30 -type f| xargs -I{} -t rm {} 2>> $LOGFILE

rc=$?
d="$(date  '+%m%d%Y %H:%M:%S')"

The easiest but not most elegant way would be to insert a grep -v "\.nfsxxx" into your pipe.
If your find version allows for it, try the -regex test for find.

Insert this into your find statement: \! -name ".nfs*"
NB xargs is problematic regarding space characters in file names; suggestion:

find . -mtime +30 -type f \! -name ".nfs*" -exec echo rm {} \; -exec rm -f {} \; >> $LOGFILE