Hi Thomas,
In case you got an open DB-File you should stop the DB-Server anyway
before running backup.
If the DB-File is not maintained by a server, the 'net file'-command
seems for me to be the easiest way
to close the open files.
For example the small version for NT-OS:
for /f "skip=4 eol=T " %i in ('net file') do net file %i /close
Or the verbose version for more informational output:
for /f "skip=4 eol=T tokens=1,2,3 " %i in ('net file') do net file %i
/close && @echo Filehandle closed: FileID %i Filename %j owned by %k
>>"%date%".log

Most backup software provide the possibility to run a batchfile before
executing backup-task.
But don�t forget to double the % for variables in batchfiles.

Thomas Beissler
System Administration


-----Urspr�ngliche Nachricht-----
Von: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Im Auftrag von
Thomas Berk
Gesendet: Mittwoch, 4. Februar 2004 19:29
An: 'Perl-Win32-Admin-Request (E-mail)'
Betreff: Closing open file sessions on a server


Does anybody have an example of how to identify and close open file
locks. I have an application that's locking a db file on a Windows 2000
server. Users are inadvertently leaving themselves logged in over night
preventing the file from being backed up.

I realize that there are risks in clearing these sessions from the
server side, but I think the risk of missed backups at least warrants
some testing (on something other than the live application db).

I've thought of using "net file" and parsing the output to produce "net
file" commands to close the sessions.  Does anybody have a better idea?

Thomas

_______________________________________________
Perl-Win32-Admin mailing list [EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs




_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to