how to know if a tape drive contain a tape. 
Author Message
 how to know if a tape drive contain a tape.

I need to do a backUp under winNT using ntbackpup; bacause Ntbackup hang if
the tape is not present in the medium, I need to know ,before run the
ntbackup command, if the a tape is avaible.

How can i do it???

Thanks !

Sergio Marchi



Mon, 06 Dec 2004 00:15:22 GMT  
 how to know if a tape drive contain a tape.

Quote:

> I need to do a backUp under winNT using ntbackpup; bacause Ntbackup hang if
> the tape is not present in the medium, I need to know ,before run the
> ntbackup command, if the a tape is avaible.

You can not know this. But you could schedule another script that will
search for lingering ntbackup process and kill it if found say 8 or 12
hours after your regular backup was started. The only catch is to allow
enough time for backup to finish, before launching "search for and kill
the process" script.

Branimir



Tue, 07 Dec 2004 20:44:39 GMT  
 how to know if a tape drive contain a tape.
Yes, this is the solution I had found:  in my script mybackup.bat, I create
first a file myfile.flg and after I run the ntBackup. After 4 hours another
script start and check the file myfile.flg exist, if is true i resta the
machine otherwise i do nothing because the mybackup.bat script had deleted
the file myfile.flg at the end of the backup.
But i would improve this backup, not starting the backup if the tape was not
present - 'cause an operator don't insert the tape .

Ok thanks a lot for interesting in it!!!

Sergio Marchi



Quote:

> > I need to do a backUp under winNT using ntbackpup; bacause Ntbackup hang
if
> > the tape is not present in the medium, I need to know ,before run the
> > ntbackup command, if the a tape is avaible.

> You can not know this. But you could schedule another script that will
> search for lingering ntbackup process and kill it if found say 8 or 12
> hours after your regular backup was started. The only catch is to allow
> enough time for backup to finish, before launching "search for and kill
> the process" script.

> Branimir



Thu, 09 Dec 2004 18:44:16 GMT  
 how to know if a tape drive contain a tape.

Quote:

> Yes, this is the solution I had found:  in my script mybackup.bat, I create
> first a file myfile.flg and after I run the ntBackup. After 4 hours another
> script start and check the file myfile.flg exist, if is true i resta the
> machine otherwise i do nothing because the mybackup.bat script had deleted
> the file myfile.flg at the end of the backup.
> But i would improve this backup, not starting the backup if the tape was not
> present - 'cause an operator don't insert the tape .

If installing WMI core on your NT4.0 servers is not just too much to ask,
then this little script will do what you need:

//
FileName: KillNTbackup.js

KillProcess("NTBACKUP.EXE");

function KillProcess(sProg) {
     var oWMI = GetObject("winmgmts:{impersonationLevel=impersonate,(Debug)}");
     var sQuery = "select * from win32_process where name='" + sProg + "'";
     var oEnm = new Enumerator(oWMI.execquery(sQuery));

     for (;!oEnm.atEnd();oEnm.moveNext()) { oEnm.item().terminate(); }

Quote:
}

Call it just before you start backup:

:: Kill old NTBACKUP.EXE process (if present)
CScript "%BATpath%\KillNTbackup.js"

:: Run backup
ntbackup backup c: d: e: /d ....

It _will_ kill old lingering process if operator forgot to insert tape for
previous backup. Interestingly, resource kit's "kill.exe" can not kill old
process (although it says it did) when ntbackup.exe is stuck displaying (to
no one - on invisible desktop) modal dialog box prompting for tape, but WMI
solution effectivley terminates it regardless. Do it this way and you can
avoid re-boot (as a way of terminating orphaned ntbackup.exe process).

Branimir



Tue, 14 Dec 2004 05:43:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. how can I know that a tape drive does not contain a tape

2. audio-tape.ps v1.21 - print cassette/DAT/8mm tape box labels

3. Eject LTO tape drive using scripting

4. Automated eject of tape drive

5. How can I know the name of the tape in the tape device?

6. How can I know the name of the tape in the tape device?

7. audio-tape.ps (long)

8. author of audio-tape.ps v1.25?

9. Cassette tape or MiniDisk label in Postscript

10. Accesso Tape (DAT) from VBscript .....

11. request: audio tape cover generator

12. Labels for Video Tapes

 

 
Powered by phpBB® Forum Software