Visit Our UNIX and Linux User Community

Top Forums UNIX for Advanced & Expert Users Failing to write retrieve script for tape to disk conversion Post 302336039 by hrsaurav on Tuesday 21st of July 2009 05:05:26 AM
Old 07-21-2009
Failing to write retrieve script for tape to disk conversion

I have the below script which has been written to retrieve files from tape drive i.e. TSM server. Now i have to write the script using UNIX commands for retrieve operation but I am not able to proceed. The script is:
#!/usr/local/bin/expect -f
set timeout 1800
set file [lindex $argv 0]
spawn $env(SHELL)
match_max 100000
log_file /home/series/apple/retrieve.log
send_log "\n\n===========================================================================\n\n"
expect -exact "\$ "
send -- "/usr/bin/dsmc rest -replace=N -optfile=/usr/lpp/adsm/bin/dsm_gold.opt $file\r"
expect {
timeout {send_log "\ntimed out waiting for TSM file restore";exit 99}
"Select an appropriate action" {send -- "A\r"}
"Restore processing finished." {send -- "\rexit\r";exit 0}
"exists, skipping" {send -- "\rexit\r";exit 0}
"No file specification entered" {send_log "\nNo file specification passed to script\n";exit 99}
"No objects on server match query" {send_log "\nNo file matches found on TSM\n";expect -exact "\$";send -- "echo \"Failed to restore $file since it was not found on the media\" | mail -s \"Apple-Testing Restore Alert-Not Found\"\r";expect -exact "\$"; exit 99}
expect {
timeout { send_log "\ntimed out waiting for TSM response";exit 99}
"ANS1074W" {expect -exact "\$";send -- "echo \"Failed to restore $file due to permissions \" | mail -s \"Apple-Testing Restore Alert-Permissions\"\r" ;exit 99}
expect -exact "\$ "
send -- "exit\r"
expect eof

Please advise and let me know in case you need any information.

Last edited by Yogesh Sawant; 07-21-2009 at 07:31 AM.. Reason: added code tags
Test Your Knowledge in Computers #389
Difficulty: Medium
Rocky Mountain BASIC (RMB) is a dialect of the BASIC programming language created by AIX.
True or False?

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Retrieve Oracle export to tape

Hi! We have an Oracle db export that was compressed and written to DLT tape directly!- This is from box1 The next step is to restore the contents of the tape into the database on box2. The problem is that there is no DLT tape drive attached to box2. There is a box3 that has the tape drive... (1 Reply)
Discussion started by: sdharmap
1 Replies

2. UNIX for Dummies Questions & Answers

Write in a tape

Hi all, I need to write on a tape drive with AIX5.3. How to know the name of this tape and what is the procedure to write on this tape? Regards, Tovo (1 Reply)
Discussion started by: tovohery
1 Replies

3. Shell Programming and Scripting

Script that can Copy a Range of files from Tape to Hard disk

Hi: I am a trying to write a script using a loop i guess. What I need to do is write a script that can allow my users to load a tape and copy a range of files from a tape to the hard disk. By range I mean, I would like the users to pick a range of numbers like files 3 - 8 and the script will... (0 Replies)
Discussion started by: msjazzie
0 Replies

4. AIX

how to use tar to retrieve all tape content

Hi, I use tar to backup the following programs: tar -cvf /dev/rmt0.1 u04/devdb/log/arch tar -cvf /dev/rmt0.1 u01/app/oracle/product/ tar -cvf /dev/rmt0 u01/app/oracle/product/ when I want to retrieve the tape content list with: tar -tvf /dev/rmt0 it... (1 Reply)
Discussion started by: victorcheung
1 Replies

5. UNIX for Dummies Questions & Answers

backup disk to disk to tape question

Hi all I had started to learn how to backup disk to disk to tape method Firstly I had backup to my NAS tar czvf /MyNetworkStorge/backup.tar /home Secondly I using dd command to copy the tar to tape dd if=/MyNetworkStorge/backup.tar of=/dev/tape0 But the tape drive always hang.... (5 Replies)
Discussion started by: lijiajin
5 Replies

6. UNIX for Dummies Questions & Answers

Help!! Failing HP-UX 11 system disk

Firstly, system setup - HP900 K460, 3 internal hard drives that make up the system volume group(vg00) no software mirroring HP-ux version 11.00 2 Nike 20 raid arrays attached, fully populated with 40 4gb hot swap drives(All used in production environment) I have 3 disks that make up my... (0 Replies)
Discussion started by: rees_a
0 Replies

7. UNIX for Dummies Questions & Answers

copy failing disk to Spare

Hi Guys, I have a failing 4gb (c0t5d0) drive that contains lvol4 -8 on hp-ux. It's not the boot disk but is part of VG00 volume group. Within that group, I have a disk (c0t4d0) of the same size that has 1 lvol on it for swap(4gb) I also have a seperate 1.5 gb swap volume on another physical disk... (1 Reply)
Discussion started by: rees_a
1 Replies

8. UNIX for Dummies Questions & Answers

unzip failing with write error

All, I am trying to unzip a file, when i doing i am seeing the below error. I have more than enough memory space in the directory where i am unziping. Can you please help me to find out the issue I dont know why i am getting disk full error. I have more space in /pa01 directory ... (2 Replies)
Discussion started by: arunkumar_mca
2 Replies

9. HP-UX

DLT 7000 tape drive failing with "write error on a record in the index"

HP rp5450 (L2000) running HP-UX 11.11B Using DLT 7000 and DLT 4000 tape drives for nightly full backups Backup jobs created by SAM DLT 7000 cron entry is as follows: 00 2 * * 1-6 /usr/sam/lbin/br_backup DLT FULL Y /dev/rmt/0m /var/sam/graphLCAa17036 root Y 1 N > /var/sam/SAM_br_msgs 2>&1... (1 Reply)
Discussion started by: dreh99
1 Replies

10. AIX

Failing to add new NetApp disk AIX 7.1 - but no error

Hello, AIX 7.1 - several NetApp disks already running. Trying to install a new one. Storage folks provision it. I run cfgmgr - nothing. no new disks show up in "lsdev", "sanlun lun show" shows no new device. No errors, just nothing. Storage guys disconnect it and attaches to another aix server -... (5 Replies)
Discussion started by: sid
5 Replies
BB-SERVICES(5)							File Formats Manual						    BB-SERVICES(5)

bb-services - Configuration of TCP network services SYNOPSIS
$BBHOME/etc/bb-services DESCRIPTION
bb-services contains definitions of how bbtest-net(1) should test a TCP-based network service (i.e. all common network services except HTTP and DNS). For each service, a simple dialogue can be defined to check that the service is functioning normally, and optional flags deter- mine if the service has e.g. a banner or requires SSL- or telnet-style handshaking to be tested. FILE FORMAT
bb-services is a text file. A simple service definition for the SMTP service would be this: [smtp] send "mail quit " expect "220" options banner This defines a service called "smtp". When the connection is first established, bbtest-net will send the string "mail quit " to the service. It will then expect a response beginning with "220". Any data returned by the service (a so-called "banner") will be recorded and included in the status message. The full set of commands available for the bb-services file are: [NAME] Define the name of the TCP service, which will also be the column-name in the resulting display on the test status. If multiple tests share a common definition (e.g. ssh, ssh1 and ssh2 are tested identically), you may list these in a single "[ssh|ssh1|ssh2]" definition, separating each service-name with a pipe-sign. send STRING expect STRING Defines the strings to send to the service after a connection is established, and the response that is expected. Either of these may be omitted, in which case bbtest-net(1) will simply not send any data, or match a response against anything. The send- and expect-strings use standard escaping for non-printable characters. " " represents a carriage-return (ASCII 13), " " represents a line-feed (ASCII 10), " " represents a TAB (ASCII 8). Binary data is input as "xNN" with NN being the hexadecimal value of the byte. port NUMBER Define the default TCP port-number for this service. If no portnumber is defined, bbtest-net(1) will attempt to lookup the portnum- ber in the standard /etc/services file. options option1[,option2][,option3] Defines test options. The possible options are banner - include received data in the status message ssl - service uses SSL so perform an SSL handshake telnet - service is telnet, so exchange telnet options FILES
$BBHOME/etc/bb-services SEE ALSO
bbtest-net(1) Xymon Version 4.2.3: 4 Feb 2009 BB-SERVICES(5)

Featured Tech Videos

All times are GMT -4. The time now is 05:11 AM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy