Video Screencast Help

bulk bpexpidate

Created: 05 Nov 2013 • Updated: 05 Nov 2013 | 11 comments
This issue has been solved. See solution.

I need to delete many images from a disk, I use a loop with the bpexpidate command with the force option, which works fine, however after each deletion it does a Activity monitor cleanup. Is there anyway to do the entire deletion without these image clean jobs showing up in the Activity Montior?

Thanks!

Operating Systems:

Comments 11 CommentsJump to latest comment

Marianne's picture

Why do you not want the cleanup to show in Activity Monitor?

It is perfectly normal for Image Cleanup jobs to appear in Activity Monitor. 
I do not believe there is a way to avoid it.

Supporting Storage Foundation and VCS on Unix and Windows as well as NetBackup on Unix and Windows
Handy NBU Links

Andy Welburn's picture

Image cleanup ----> Activity Monitor -- default (bpimage -cleanup -allclients)

bpexpdate ----------> Activity Monitor -- how? (bpexpdate -force -d 0 .....)

 

Well that's how I remember it anyway!

What commands are you actually running? Have you got a cleanup in the loop & if so can you just run it once at the end?

Mark_Solutions's picture

When you run a bpexpdate it will run the image cleanup in activity monitor - if using a lop / script it will run after each one - havent tried a bulk one but you could test it (search the catalog for the images you want to expire - highlight them all  - right click - expire)

I suspect that you will still get one for each image that expires

Authorised Symantec Consultant

Don't forget to "Mark as Solution" if someones advice has solved your issue - and please bring back the Thumbs Up!!.

Nicolai's picture

It's default behavior and can't be changed.

In previous releases where disk images was deleted later image files could be left behind if that job failed or the server crashed. This is resolved now - but the side effect is a image clean job per backup expired.

Assumption is the mother of all mess ups.

If this post answered your'e qustion -  Please mark as a soloution.

SOLUTION
nbugermany's picture

This is the script I run:

#! /bin/bash
for i in $(cat /tmp/may);
do bpexpdate -backupid $i -copy 1 -d 0 -force > redirect_log 2>&1;
done;

In the file /tmp/may it can have hundreds of individual images, which just fills up my Activity monitor, it is not causing any problem, but just a bit sillly to see.

If I use bpimage -cleanup instead of bpexpdate, will it also show up in the Acitivity monitor?

Thanks
 

Andy Welburn's picture

Ignore my comments from earlier - I'm still living in the past & it appears that the way bpexpdate runs has changed per Mark & Nicolai's comments. The bpimage command was used cleanup any expired images etc - not sure if any of this has also changed - & it was only this that used to appear in the AM & not the bpexpdate.

quebek's picture

After expiring images you can always run this:

for i in `bpdbjobs |grep "Image Cleanup" |awk '{print $1}'` ; do echo deleting job $i; bpdbjobs -delete $i; done

 

And your Acitivity monitor will be clean from these entries

Marianne's picture

bpimage -cleanup will only cleanup already expired images from the image database.
 

There is no way to prevent cleanup jobs from appearing the Activity Monitor.

I find it strange that you need to expire 'hundreds of images'. 
Surely there are enough strategies available within NBU to manage expiration of disk images?

Supporting Storage Foundation and VCS on Unix and Windows as well as NetBackup on Unix and Windows
Handy NBU Links

Darren Richardson's picture

Try using the -notimmediate switch when expiring lots of disk based images.

This speeds up the command and the cleanup will then run at a later time.

- Darren

Jim-90's picture

I found out the hard way about how Linux reacts to running a lot of stuff as background jobs.  Running things in the background can use up all of the swap.  Once swap is used up you have hung/messed up the server. Check out some doco on "swappiness" Here's a start : http://en.wikipedia.org/wiki/Swappiness

I used to run VTLs that manually required carts to be erased in order free up VTL disk space.  Doing a quick erase of pretend disks in loop would only do one cart at time.  Doing the same job but as a background job would result in a queue and all pretend tape drives could be used in parllel which speeded up the process at lot . That was good until system came to occasional halt/crash. The is the potential here to shove a lot of stuff as background jobs and if the system become unhinged -  swappiness is probably the casue.