I'm trying to work out a way to close down open files that are open via CIFS.
We use some of our nas storage for home drives, which hold users email system files. (lotus notes).
If we suffer any slowdowns at logon then we'll see a large number of them getting some of these notes files locked open and they need closing off by an admin before the user can get into their emails.
This is currently done via MMC and finding the open files.
Does anyone know of a way to do this from command line ?? I'd like to script up a tool to do this with a set file path rather than do each one through a gui everytime.
I've tried the lock break -f command without any success.
You could break the files by protocol or by files/owner:
1. First find out needs to be broken, per user:
lock status -o owner [-f file] [-p protocol] [-n] (valid for CIFS only)
owner = [domain\]username (CIFS)
protocol = cifs
2. then break
lock status break -o owner [-f file] [-p protocol] [-n] (valid for CIFS only)
If you want to reset all CIFS locks you can:
lock break -p cifs
I d recommend you do some testing if you can first and make a call if you want to break per protocol or client.
I'll give it a test but I'm not sure it will be usable in my scenario as I specifically want to close 1 single open file.
My users are quite likely to have other open files they want but if it works I can always procedurise it get round that step and get them to save any work first.
If you notice the options for lock command you will find that there you have to supply file path in /vol/volname/qtree/directory/file...... format so it will break lock only for that specific file and not for all users. if you wish you can also look into man pages for detailed information however here's the command you would like to run.
lock break -p cifs -f /vol/vol1/qtree1/somefile.doc