• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1129
  • Last Modified:

TSM Tape pool Migration process script

My TSM server is AIX 5.3. I have to modify the TSM DRM script which does the migration of TBCAK pools to CBACK pools. We already have a script, but this script runs the migration processes in sequential order i.e. tback6 (this one is big data which takes approx 6 hours to complete), then tback5,tback3,tback2,tback1. I want these script to start the tback6 migration first, then parallely do the migration of remaining tback pools to cback pools which can reduce time for our daily process to complete. I have modified the script, but it is giving problem. I am using 2 while loops in the same. First while loop starts the tback6 migration, then it goes to second while loop and works fine, but when it doest not come out of second while loop and doesnt checks the status of tback6 is still going on. What can be done to exit the 2nd while loop and then again go to 1st while loop to check the status of tback6 migration and running and wait until that completes. From line 8 it does not goes to 1st loop. Because, I dont want the db backup to start until all the migrations are done. I am attaching the script for your reference. The /tmp/prim_pools files contain following tback names:

tback6
tback5
tback33
tback2
tback11
tback1

Thanks
virgo
tsm-test-script.txt
0
virgo0880
Asked:
virgo0880
  • 5
  • 3
3 Solutions
 
simon3270Commented:
Assuming that there is only one tback6 line, you don't need a loop for the first backup.  just have:

    ET_LINE=`cat /tmp/prim_pools|egrep TBACK6`

then remove the "do" after that line, and the "done" at the end.

Does the dmsadmc command which performs the backup automatically go into the background? If not, you need to put the each "dsmadmc" line into the background, by adding & at the end, for example:

    dsmadmc -id=test -pass=test upd stg $TPL $CPL maxpr=2 &

The other thing to do is to make sure that the while loop waiting for tback5, 4, 33 etc terminates cleanly - put some debug into the loop, to print out the value of $CNT on each loop - add something like this on the line after the "CNT=...":

    echo At $(date), count is $CNT for backup $TPL
0
 
virgo0880Author Commented:
Ok, understood for the first while loop. But what happens is remaining tback5,1,33,2 pools gets finished early than tback6 and then starts the tsm db backup which I dont want. Can you help me in getting the second while loop do a clean exit and wait until tback6 gets complete. What commands can I add in 2nd while loop to exit it clean?

Btw, the dsmadmc process starts in the background only, it gives the command to the tsm console and returns back. So no need to do it background.

virgo
0
 
woolmilkporcCommented:
I hope the pool names in /tmp/prim_pools are UPPERCASE!
0
Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

 
virgo0880Author Commented:
yes, they all are upper case. can you help me to make that script work with while loops the way I want?

Thanks
0
 
woolmilkporcCommented:
Are you aware that this:

CPL=`echo $ET_LINE |awk '{print substr( $1, 1, 6 )}' | sed -e "s/TBACK/CBACK/g" `

will lead to backing up TBACK11 to CBACK1 and TBACK33 to CBACK3. Is this desired?

Further, I assume the (commented out) dsmadmc commands must read "ba stgp" instead of "upd stgp"!
0
 
virgo0880Author Commented:
Yes, I am aware of all the stuff there and that is what I need. It is desired and I want it that way and also "ba stg" is there in my script instead of "upd stg". I made a typo there.

I just want to know how to cleanly exit the 2nd while loop so that when it finishes backing up tback5,tback1,tback11,tback33 and tback2, it should check if tback6 is still running or not and once tback6 completes then it should proceed with the next step i.e. tsm db backups which I have not copied in the script above.

Virgo
0
 
woolmilkporcCommented:
OK, the only thing we can do is check your loop condition.

So add just before this line:

CNT=`dsmadmc -id=admin -password=admin q pr|grep "Backup"|grep $TPL6|wc -l`

these:

echo $TPL6
dsmadmc -id=admin -password=admin q pr|grep "Backup"
dsmadmc -id=admin -password=admin q pr|grep "Backup"|grep $TPL6
dsmadmc -id=admin -password=admin q pr|grep "Backup"|grep $TPL6 | wc -l

What do you see?
0
 
virgo0880Author Commented:
I see the script is putting the output properly and also it seems to be working fine waiting for TBACK6 to complete. I have not done any modifications to the script. But I will still look to see if that completes without any issues. I will need some time to reply back on this.

Thanks for your inputs

virgo
0
 
virgo0880Author Commented:
I modified the loop in the script to start the migration processes parallely.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now