Automating executing commands on multiple tapes and changing (loading) them


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Automating executing commands on multiple tapes and changing (loading) them
# 1  
Old 11-05-2009
Automating executing commands on multiple tapes and changing (loading) them

The thing that we need to be able to do is:

- Scanning tapes from failed backup jobs with bscan (a bacula command)
- loading the next tape with the mtx command

Bscan does unload tapes but does not load them.

Bscan comes with this message when it's done with a tape:

Mount Volume "XO7563L3" on device "Tape1" (/dev/nst0) and press return when ready:

The script doesn't have to be fancy like determine in what slot the volume is. It would be enough just loading the tapes from let's say slot 10 to 24 and we need to make sure they are loaded in the right order into the tape library.

The thing that we ran into is that when the above message appears it normally should input the answer but in this case it should run another command first and then input the answer.

Is Expect the program for the job and how to do it?

Thanks...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Executing multiple commands in a file at same time

Hi Am having file.ksh as below wc -l file1.txt wc -l file2.txt wc -l file3.txt wc -l file4.txt i want all the commands in this file to execute in same time please help Thanks in advance (1 Reply)
Discussion started by: ragu.selvaraj
1 Replies

2. Shell Programming and Scripting

Executing multiple ssh commands inside a shell simultaneously

I would like to execute a commands in four different servers through ssh at a single instance(simultaneously). Below are the details with examples, ssh user1@server1 "grep xxxx logs" ssh user1@server2 "grep xxxx logs" ssh user1@server3 "grep xxxx logs" Each statement will take some... (4 Replies)
Discussion started by: Amutha
4 Replies

3. Shell Programming and Scripting

Automating execution of commands inside a program

I have a program dnapars I execute the program from command line as following: ./dnapars The program then prompts me some message as a user menu from where I have to select a series of options in the order R U Y R. And then I copy the output file (outfile) in another result file. I wrote the... (3 Replies)
Discussion started by: deeptisjains
3 Replies

4. Shell Programming and Scripting

Need help with executing multiple commands in remote machine

Hi, I work on a jumpserver and I wrote a script to transfer a file from source server to destination server. #!/bin/ksh echo "\nEnter the file name:\n" read name echo "\nSelect the Source server\n" echo "1. ODS PROD " echo "2. ODS DROPBOX" echo "3. ODS STE" echo "4. ODS STE DROPBOX"... (6 Replies)
Discussion started by: ajayakunuri
6 Replies

5. Solaris

Help with executing multiple remote commands after multiple hops

Hi SSHers, I have embedded this below code in my shell script.. /usr/bin/ssh -t $USER@$SERVER1 /usr/bin/ssh $USER2@S$SERVER2 echo uptime:`/opt/OV/bin/snmpget -r 0 -t 60 $nodeName system.3.0 | cut -d: -f3-5` SSH to both these servers are public-key authenticated, so things run... (13 Replies)
Discussion started by: LinuxUser2008
13 Replies

6. Shell Programming and Scripting

Executing commands

I need to execute a command to run my script several times with varying parameters perl ex.pl -b 130198 -e 130884 -c plot plot.txt 1_plot.txt perl ex.pl -b 1345 -e 1308 -c plot plot.txt 2_plot.txt perl ex.pl -b 1345567 -e 130898 -c plot plot.txt 3_plot.txt . . . 100's of excutions ... (2 Replies)
Discussion started by: Lucky Ali
2 Replies

7. Shell Programming and Scripting

Executing many commands at once

Hi, I want to run these two commands one after the other. awk 'BEGIN {OFS="\t"} {print $2}' sort -u rather than typing awk 'BEGIN {OFS="\t"} {print $2}' file1 > file2, then sort -u file2 > file3. Is it possible to run both commands on file1 then get output file3? Its kinda hard for... (5 Replies)
Discussion started by: kylle345
5 Replies

8. Shell Programming and Scripting

Executing Commands From Non-Standard Path (Changing user's PATH secretely???)

Hi: I have a requirement as below: I have some standard Unix commands modified and kept them in a directory say /usr/clsh/bin. For example I have a script named "ls" kept here which is modified version of "ls" (say it always gives long listing i.e. ls -l). When any user logs on and types... (2 Replies)
Discussion started by: ramesh_samane
2 Replies

9. Red Hat

How commands are executing ?

Hi Folks, I have a small doubt, the binary commands under /bin and /sbin as well as other path binary files, if you peek deep into that, you can find the difference in the way of normal perl programming and some commands will be like binary files. how are the commands executing like the... (3 Replies)
Discussion started by: gsiva
3 Replies

10. UNIX for Dummies Questions & Answers

how to tar to multiple tapes

how to tar to multiple tapes (1 Reply)
Discussion started by: sean dixon
1 Replies
Login or Register to Ask a Question
ndmpstat(1M)						  System Administration Commands					      ndmpstat(1M)

NAME
ndmpstat - show NDMP backup progress statistics SYNOPSIS
ndmpstat [tapes] [interval [count]] DESCRIPTION
The ndmpstat utility reports Network Data Management Protocol (NDMP) statistics, among which are NDMP worker threads, disk IO, tape IO, files operation, performance, and backup activity. ndmpstat reports the aggregate statistics for all tapes and disks. In order to obtain statistics for specific tape devices, the tape device name should be passed as argument to the utility. When invoked, ndmpstat begins its display with a one-line summary of the NDMP daemon activity since the NDMP service was invoked. Display Fields The fields in ndmpstat output are described as follows: wthr Report the number of worker threads in each of the four following states: r the number of worker threads running w the number of blocked worker threads that are waiting for resources such as I/O and paging b the number of backup operations currently running r the number of restore operations currently running file Report on usage of filesystem. rd the number of files being read wr the number of files being written disk Report the number of disk operations per interval. rd the number of disk blocks being read wr the number of disk blocks being written tape Report the number of tape operations per interval. There are slots for up to four tapes, labeled with a single number. The number indi- cates the name of the device under /dev/rmt. rd the number of tape blocks being read wr the number of tape blocks being written bytes Report the number of bytes transferred. This is the aggregate value of both tape and disk devices. The number is in kilobytes. rd the number of kilobytes being read wr the number of kilobytes being written perf Displays a rough estimate of performance of the backup/restore operation in megabytes per second. bk backup performance rs restore performance prcnt Display the comparative usage of resources, in percent. dsk disk I/O time tpe tape I/O time otr other time (memory or idle) See EXAMPLES. OPERANDS
The following operands are supported: count Specifies the number of times that the statistics display is repeated. tape Specifies which tapes are to be given priority in the output. A command line is limited to a maximum of four tape devices. A common tape name is /dev/rmt/n, where n is an integer. interval Specifies the number of seconds over which ndmpstat summarizes activity. The specified interval remains in effect till the com- mand is terminated. EXAMPLES
Example 1 Using ndmpstat The following command displays a summary of NDMP daemon activity at five-second intervals. example% ndmpstat 5 wthr file disk tape bytes perf prcnt r w b r rd wr rd wr rd wr rd wr bk rs dsk tpe otr 1 0 3 6 50 9 1250 0 32544 4455 42335 3234 5 4 20 40 40 1 0 0 1 1 0 128 0 0 128 64 64 1 0 0 80 20 1 0 0 1 2 0 128 0 0 0 64 0 1 0 80 0 20 1 0 0 1 1 0 128 0 0 0 64 0 1 0 80 0 20 1 0 0 1 3 0 128 0 0 0 64 0 0 0 80 0 20 1 0 0 1 1 0 128 0 0 128 64 64 1 0 0 80 20 ^C example% ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWndmpu | +-----------------------------+-----------------------------+ |Interface Stability |See below | +-----------------------------+-----------------------------+ Invocation is evolving. Human readable output is unstable. SEE ALSO
iostat(1M), mpstat(1M), ndmpd(1M), ndmpadm(1M), attributes(5) NOTES
Performance numbers are not accurate and are rounded up at the MB/sec. boundary. SunOS 5.11 21 Jun 2007 ndmpstat(1M)