06-18-2015 06:40 AM
Can someone please tell me how to find out highest retention of image through command line when the image is in SLP control and SLP is not yet completed.
We have 2 copies of backups. 1st copy with 1 month of retention on local site and 2nd copy has higher retention (greater than 3 months) on remote site.
I tried bpimagelist but it gives retention of 1 copy only and expiration time as 2038 if SLP is not yet completed for 2nd copy. Only when the SLP is completed Image database shows correct expiration time(highest of two copies).
Solved! Go to Solution.
06-19-2015 07:43 AM
nbstlutil also seems to give infinity (2038), but looking at a complete SLP it would appear the "Try To Keep Time" is the same as the expire time and it seems nbstlutil gives this date while SLP is active so you can use:
nbstlutil list -U -rt IC -backupid xxxx
and this would seem to give the expiry of each copy in the "Try To Keep Time" field
You can run without -U and then "Try To Keep Time" is the 7th field.
You can run without a backupid to get all images, so the script below will give you all copies and sorts by expiry date:
printf "%10s %10s %3s %10s %s\n" "Expiry" "Copy State" "Cpy" "Copy Type" "Backup id" nbstlutil list -rt IC | awk ' BEGIN {copytype[0]="Backup" copytype[1]="Duplicate" copytype[3]="Replicate" copystate[2]="IN_PROCESS" copystate[3]="COMPLETE" } $2 == "I" {backupid=$4;} $2 == "C" && $19 == 0 {next} $2 == "C" {printf "%10d %10s %3d %10s %s\n", $7, copystate[$9], $5, copytype[$19], backupid}' | sort
Note nbstlutil can take a few minutes to complete without "-backupid" to give back all records, or you can add "-backupid" to nbstlutil command in script above to get one image quickly and either way you will get output like:
Expiry Copy State Cpy Copy Type Backup id 1435860246 IN_PROCESS 2 Duplicate server1_1434650646 1437329046 COMPLETE 102 Replicate server1_1434650646
If you are using nawk in Solairs 11 or gawk on solaris 10, then you can convert epoch time to readable time using strftime function.
Mike
06-18-2015 06:47 AM
There is nothing that will give you the answer other than looking at the SLP.
As you have noticed - retention of source copy is set to Infinity until all copies have been made.
06-18-2015 07:07 AM
you have two options
use bpimagelist -l -backupid xxxx and filter the lines that start with "FRAG x 1". That is "FRAG 1 1", "FRAG 2 1", "FRAG 3 1" and so on. The first number after the FRAG is the copy number.
The 17th column is the copy expiration time in UNIX format and 19th the retention level (plus 65536)(https://support.symantec.com/en_US/article.TECH5584.html)
use the command bpdbm -ctime to convert the ctime to human readable date.
IMAGE xxxxxx 0 0 9 xxxx_1434586443 Lys-SQL-B 15 *NULL* SYSTEM Default-Application-Backup 2 3 1434586443 37 1435450443 0 0 33768 5 2 4 0 xxx-S
BAK.f *NULL* *NULL* 0 1 0 0 0 *NULL* 1 0 0 0 0 0 0 *NULL* 0 0 0 *NULL* 16265856 0 0 2287 0 0 *NULL* SLP-xxx-DB-1 3 0 115 0 *NULL* *NULL* 0 1 0
HISTO 0 0 0 0 0 0 0 0 0 0
FRAG 1 1 0 0 2 6 85 006612 xxxxx 65536 3031929 1434433380 25 0 *NULL* 1437264843 1 65539 0 0 0 0 1437264843 1434586480 1 1 *NULL* *NULL* 0
FRAG 1 2 33768 0 2 6 86 006612 xxx 65536 3042477 1434433380 25 0 *NULL* 1437264843 1 65539 0 0 0 0 1437264843 1434586480 1 1 *NULL* *NUL
FRAG 2 1 0 0 2 6 212 006496 xxxx 65536 17555221 1434433380 19 0 *NULL* 1435450443 1 65548 0 0 0 0 1435450443 1434586480 1 1 *NULL* *NULL*
FRAG 2 2 33768 0 2 6 213 006496 xxxx 65536 17565769 1434433380 19 0 *NULL* 1435450443 1 65548 0 0 0 0 1435450443 1434586480 1 1 *NULL* *N
the second option is to run the bpimage list -L -backupid command.
search the Expiration time of every Fragment 1 of every copy.
Copy number: 1
Fragment: 1
Kilobytes: 0
Remainder: 0
Media Type: Media Manager (2)
Density: hcart (6)
File Num: 85
ID: 006612
Host: xxxxxxxx
Block Size: 65536
Offset: 3031929
Media Date: 6/16/2015 8:43:00 AM (1434433380)
Dev Written On: 25
Flags: 0x0
Media Descriptor: ?
Expiration Time: 7/19/2015 3:14:03 AM (1437264843)
MPX: 1
retention_lvl: 1 month (3)
Try to Keep Time: 7/19/2015 3:14:03 AM (1437264843)
Copy Creation Time: 6/18/2015 3:14:40 AM (1434586480)
use bpimaglelist -L if you have one backup to find but use bpimagelist -l if you have more images and you want to script it.
06-18-2015 07:41 AM
Ok Marianne. I was wondering if there is any other way to find the highest retention of images. We have many images with infinity retention and we were planning to duplicate them manually and removing them from SLP control.
@ Stefenos - bpimagelist shows retention as infinity until all images are done. so we can't really check from bpimagelist. If I have both the backup copies done then yes it show the highest retetention of source copy. In our case only first copy is done.
06-18-2015 08:16 AM
The only other suggestion from my side will be to list incomplete SLP images.
Something like: bpimagelist -idonly -hoursago <hours> -stl_incomplete
and remove those from your previous bpimagelist output.
06-19-2015 02:52 AM
I was not in frond of netbackup yesterday, I'm trying to check it now.
I'm working with the latest NBU version, but something does not fit. I know that the retention at the IMAGE line is infinity, but the bpimagelist gives me the original retention !!!
$ bpimagelist -stl_incomplete
IMAGE backup 0 0 10 backup_1434705758 zzz-test 13 *NULL* root ful 0 23 1434705758 146 1435483358 0 0 2069324 11667 1 1 0 zzz-test_1434705758_FULL.f *N
ULL* *NULL* 0 1 0 0 0 *NULL* 0 0 0 0 0 0 0 *NULL* 0 0 0 *NULL* 79367 0 0 1512000 0 0 *NULL* Dedup_to_tape_week 1 0 4 0 *NULL* *NULL* 0 1 0 0
HISTO 0 0 0 0 0 0 0 0 0 0
FRAG 1 1 2069324 0 0 0 0 @aaacl ptbackup01 1048576 0 0 -1 0 1;PureDisk;ptbackup01;msdp_pool;PureDiskVolume;0 1435483358 0 65559 0 0 0 6 0 1434705904 1
1 *NULL* *NULL* 0 0stefanos@BACKUP /d/Program Files/Veritas/NetBackup/bin/admincmd
$ bpimagelist -stl_incomplete |grep IMAGE |awk '{print $16}'
1435483358stefanos@BACKUP /d/Program Files/Veritas/NetBackup/bin/admincmd
$ bpdbm -ctime 1435483358
1435483358 = 28/6/2015 12:22:38 ΉΉ
I still think that you can get the retention from the bpimagelist. I will inform the threat
06-19-2015 04:04 AM
From memoery, incomplete SLP images used to show as infinity in bpimagelist output, this was changed some time ago to show the 'original' retention period.
So, NBU is working as designed.
06-19-2015 04:17 AM
OK, good to know.
I was trying to find if I had a problem with my SLPs.... :)
@KS2: Can you post the output of the "bpimagelist -l -backupid xxxx" command ?
I want to have a look, if I can find the original retention.
06-19-2015 07:43 AM
nbstlutil also seems to give infinity (2038), but looking at a complete SLP it would appear the "Try To Keep Time" is the same as the expire time and it seems nbstlutil gives this date while SLP is active so you can use:
nbstlutil list -U -rt IC -backupid xxxx
and this would seem to give the expiry of each copy in the "Try To Keep Time" field
You can run without -U and then "Try To Keep Time" is the 7th field.
You can run without a backupid to get all images, so the script below will give you all copies and sorts by expiry date:
printf "%10s %10s %3s %10s %s\n" "Expiry" "Copy State" "Cpy" "Copy Type" "Backup id" nbstlutil list -rt IC | awk ' BEGIN {copytype[0]="Backup" copytype[1]="Duplicate" copytype[3]="Replicate" copystate[2]="IN_PROCESS" copystate[3]="COMPLETE" } $2 == "I" {backupid=$4;} $2 == "C" && $19 == 0 {next} $2 == "C" {printf "%10d %10s %3d %10s %s\n", $7, copystate[$9], $5, copytype[$19], backupid}' | sort
Note nbstlutil can take a few minutes to complete without "-backupid" to give back all records, or you can add "-backupid" to nbstlutil command in script above to get one image quickly and either way you will get output like:
Expiry Copy State Cpy Copy Type Backup id 1435860246 IN_PROCESS 2 Duplicate server1_1434650646 1437329046 COMPLETE 102 Replicate server1_1434650646
If you are using nawk in Solairs 11 or gawk on solaris 10, then you can convert epoch time to readable time using strftime function.
Mike