Failing to write retrieve script for tape to disk conversion

Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Failing to write retrieve script for tape to disk conversion
# 1  
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 08:31 AM.. Reason: added code tags
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
Login or Register to Ask a Question