Netbackup 6.5 mass phase 1 import solution needed

This issue has been solved. See solution.
Outbacker's picture

Hi Everyone,

I've got a little predicament here. I'm inheriting a massive amount of unknown tapes that they have organized by month only that they need phase 1 imported because they never offsited a catalog tape (YIKES!). Doing this manually through the gui is a massive pain. I went to go and make a command line entry, which is fine, except if i have it spit out all of them at once then the imports lock up because they are all fighting each other over the tapes. Does anyone have a script that allows you to stick a list of tapes to perform a phase 1 import and that it will go and perform the phase 1 one or two at a time?

Basically, I could have a list of tapes like:

QWV901L2
QWV902L2
QWV903L2
QWV904L2
XKY905L2
TWX144L2
QWV952L2

etc.

and i can only provide it 1 or 2 tape drives at a time without impacting the rest of the environment. I'd like it to go through and perform the phase 1 on each of them. I then will go back and manually set the expiration time before doing phase 2.

Let me know what your thoughts are or if anyone has a solution to this. Doing this through the gui is annoying and i also lose my space as i have to wait for it to finish and go back and check a list. Versus a cron job.

Thanks,
Austin Lazanowski

rj_nbu's picture

command line phase 1 import

Hi

You can try the bpimport command

/usr/openv/netbackup/bin/admincmd/bpimport -create_db_info -id <mediaid> -server <master_server_hostname> -L <progress_log>

This will do a phase 1 import for a tape, but first you have to inventory the library and move those tapes to a NEW volume pool , so the the tapes aren't overwritten

-Rajeev
"Unix IS user friendly... It's just selective about who its friends are"

Outbacker's picture

Not what i need

Hi Rajeev, if you read my earlier statement, i said that the single command line i've already attempted to use but i need it to automate that import list based on a list of tapes after each individual job is complete. This is a bit more complicated than the average import 1-2 tapes; we're talking close to 400 tapes that im having to manually import and would like a more scripted version if possible. If it "cant be done" then i'll spend some time developing the cron wait scripts, i figured someone else has just run into this situation and found their own solution.

Thanks.

-Austin Lazanowski
Backups cost way too much until you needed them.

dennis sexton's picture

re: bpimport from command line

Solution

The import from the command line will not go into background as far as I remember, so you could create a file list with a single mediaid per line
and then do something like

for i in `cat tapelist`
do
bpimport -create_db_info -mediaid $i -server $servername -L /path/to/log
done

Assumes Bourne or zsh in a Unix variant of course. No idea how to do it in winders

stu@symantec's picture

Not done.

You might want to include some sleep statement, but you should also save the backupIDs into a list so you can do phase2:

for i in `cat tapelist`
do
bpimport -create_db_info -mediaid $i -server $servername -L /path/to/log_phase1
sleep 3
done

# get all images found from phase 1 into file:
bpimport -PM -s 01/01/71 00:00:00 -e <todays_date> -id <media_id> | awk '{print $5}' >> /tmp/phase2.import_list

# initiate phase 3:
bpimport -Bidfile /tmp/phase2.import_list -L /path/to/log_phase2
 

Darren Dunham's picture

import time

Don't forget that the phase1 information doesn't stay around indefinitely.  It could take you longer than that to finish all the imports.  If that happened, you'd never be done because the older data would already be purged by the time you reached the end of the list.

--
Darren

Outbacker's picture

Thanks everyone!

Good to note, i'll make sure to change the expdate as soon as its done with one of the tapes. That'll be easier though than manually typing in the things to import.

-Austin Lazanowski
Backups cost way too much until you needed them.