cancel
Showing results for 
Search instead for 
Did you mean: 

bplist not working

goldenret67
Level 3

Hello.

would very much appreciate if anyone could assist as I can't seem to make bplist work... it was working prior to upgrading our netbackup version to 7.6.. but I can't seem to extract any information using bplist within the 7.6 environment.. any help/assistance would be greatly appreciated...

thanks in advance.

 

br

ken

1 ACCEPTED SOLUTION

Accepted Solutions

sdo
Moderator
Moderator
Partner    VIP    Certified

The status 227 is not a syntax issue.  If you are 100% sure that backup image content does actually exist, and thus should be 'listable', then it really boils down to one or more parameters/switches to bplist are either rmissing or incorrect.  Remember this, bplist forms the core basis of all restores, i.e. any browse, and any (and I do mean *all*) restores actually rely on a functionally accurate bug-free 'bplist'... and so, I'm sorry to say this, but it is highly unlikely that you've uncovered a new bug... and therefore it is quite likely that what is actually hapenning is that we're missing something from the bplist CLI command line when we call it, or a configuration element (or multiple elements) within NetBackup has changed since 'the exact same command' was last used to run a successful listing, and thus the command that we're using is either imcomplete and/or inaccurate, or will never work until some other local site-specific configuration element is corrected/re-corrected/re-instated/changed.

View solution in original post

15 REPLIES 15

sdo
Moderator
Moderator
Partner    VIP    Certified

Please post the failing command?

goldenret67
Level 3

Hello...

regardless of the parameter.. it always returns 227.

bplist.exe -C <clientname> -s <date> -b -l -R 2 /

Note: even if I identify any policy type.. it is still returning exit code 227.. :(

thanks.

br

ken

sdo
Moderator
Moderator
Partner    VIP    Certified

Going to need to see the full failing command, sorry.

sdo
Moderator
Moderator
Partner    VIP    Certified

On a Windows 2012 R2 NetBackup Server v7.7 master/media I get 80 lines of output:

J:\> bplist -C client01 -l -b -s 01/01/1970 00:00:00 -R 2 / | find /i /v /c ""
80

...and the same number of output lines when not specifying a time:

J:\>bplist -C client01 -l -b -s 01/01/1970 -R 2 / | find /i /v /c ""
80

.

Wondering what versioninfo shows for you for your bplist.exe binary?  Mine shows:

J:\>versioninfo -f "D:\Program Files\Veritas\NetBackup\bin\bplist.exe"
======= D:\Program Files\Veritas\NetBackup\bin\bplist.exe =======
@(#) NetBackup_7.7​

.

Where are you running the command:

1) On the master server?

2) On a client, querying it's own backups?

3) On a client, querying backups for another client?

.

For option 1) above... the command should always work on the master.

However, for options 2) and/or 3) above, maybe the 'Client_Name' inside the client (registry/bp.conf) no longer matches the client name used in the backup policy - AND - you don't have a corresponding ALTNAMES entry allowing client 'A' to list backups for client 'B' ?

goldenret67
Level 3

sadly... no luck!!!! when running the bpclient.. i only see a handfull of clients (mostly physical servers).. don't see any of the virtual servers... could be something easy.. but will discuss this with the backup admin on monday to see what's going on...

I'm running this on the master server... :)
 

thanks.

sdo
Moderator
Moderator
Partner    VIP    Certified

1) Can you not post the full bplist command that fails?

2) If you state the actual client name for the backups that you want to list, then I can give you a command to attempt to list all backup images for that client name.

3) And, if you can also supply the policy type, or client type, i.e. WindowsNT or Standard etc, then I can give you another command to list the client's view of backup images. 

Nicolai
Moderator
Moderator
Partner    VIP   

You need to specify policy type -t 40 for VMware backup 

e.g 

bplist -C client01 -l -b -s 01/01/1970 -R 2 -t 40 / 

Marianne
Level 6
Partner    VIP    Accredited Certified
You also need to double-check the clie name. Look in db\images folder on the master and see if you can fin the Client name. If you do, open folder and check in sub-directory. Do you see recent files/folders? The name you specify with -C needs to match client folder name in images exactly. You may want to add date range as well.

sdo
Moderator
Moderator
Partner    VIP    Certified

The status 227 is not a syntax issue.  If you are 100% sure that backup image content does actually exist, and thus should be 'listable', then it really boils down to one or more parameters/switches to bplist are either rmissing or incorrect.  Remember this, bplist forms the core basis of all restores, i.e. any browse, and any (and I do mean *all*) restores actually rely on a functionally accurate bug-free 'bplist'... and so, I'm sorry to say this, but it is highly unlikely that you've uncovered a new bug... and therefore it is quite likely that what is actually hapenning is that we're missing something from the bplist CLI command line when we call it, or a configuration element (or multiple elements) within NetBackup has changed since 'the exact same command' was last used to run a successful listing, and thus the command that we're using is either imcomplete and/or inaccurate, or will never work until some other local site-specific configuration element is corrected/re-corrected/re-instated/changed.

goldenret67
Level 3

Thank you sooooo Marianne... being able to see the list helps.....

I will confirm with the backup guys and seems like the problem is really whether or not there is data that the bplist can pull/extract...

br

Ken

goldenret67
Level 3

Thanks sooo much...

with all your inputs... I can now extract data from bplist.. but need to work with thebackup guys howcome som servers does not have any backup information.. .as mentioned, bplist is working but is dependent on whether or not the paramters fed to the command allows it to extract sufficient data.....

bieing able to see the list of clients helped a lot!!!! (db\images folder).

thanks to all!

br

Ken

sdo
Moderator
Moderator
Partner    VIP    Certified

If you're struggling to locate client names, e.g. sometimes the client names no longer exist in policies, yet backups do still exist, then this reporting script may help you locate client names and their backups:

@echo off
setlocal enabledelayedexpansion

REM ****************************************************************************************************
REM *    File:    find-client.bat
REM *    Desc:    To search for partial matches of client names for images that exist.
REM *
REM *    Vers    Date        Who    Description
REM *    ----    ----        ---    -----------
REM *    v0.01    17-JUL-2015    sdo    First version.
REM *    v0.02     8-AUG-2015    sdo    Added version table, and notes, use wmic to get date.
REM ****************************************************************************************************
REM *    Notes
REM *    -----
REM *    1) This script was developed and tested using Windows 2012 R2 and NetBackup Server v7.7, however
REM *       it should work on any Windows version since 2003, and any NetBackup Server version v7.x.
REM *    2) This a reporting/listing type script only, and does not make any changes to the configuration
REM *       of NetBackup.
REM *    3) This script does retain collected lists of images, for future reference, and so each 'date'
REM *       that it is run, it will collect and keep a list of all images, but this list is the "-idonly"
REM *       type list, and so should not consume too much disk space over time.
REM ****************************************************************************************************


REM ***********************************************************************************
REM ***********************************************************************************
REM *** Where am I, and who am I?

set z_path=%~dp0
set z_name=%~n0


REM ***********************************************************************************
REM ***********************************************************************************
REM *** Get today's date in YYYY-MM-DD format...
REM ***    ...this loop handles dates from years 0000 to 3999...

for /f "tokens=1 skip=1" %%a in ('wmic os get localdatetime') do (
  set z_string=%%a
  if "!z_string:~0,1!"=="0"  set z_date=%%a
  if "!z_string:~0,1!"=="1"  set z_date=%%a
  if "!z_string:~0,1!"=="2"  set z_date=%%a
  if "!z_string:~0,1!"=="3"  set z_date=%%a
)

set z_date_yyyy=!z_date:~0,4!
set z_date_mm=!z_date:~4,2!
set z_date_dd=!z_date:~6,2!

set z_date_yyyy_mm_dd=!z_date_yyyy!-!z_date_mm!-!z_date_dd!


REM ***********************************************************************************
REM ***********************************************************************************
REM *** Build this scripts working and reporting file names...

set z_file_cli=!z_path!!z_name!-!z_date_yyyy_mm_dd!.cli
set z_file_fin=!z_path!!z_name!-!z_date_yyyy_mm_dd!.fin
set z_file_ima=!z_path!!z_name!-!z_date_yyyy_mm_dd!.ima
set z_file_lis=!z_path!!z_name!-!z_date_yyyy_mm_dd!.lis
set z_file_log=!z_path!!z_name!-!z_date_yyyy_mm_dd!.log
set z_file_tmp=!z_path!!z_name!-!z_date_yyyy_mm_dd!.tmp


REM ***********************************************************************************
REM ***********************************************************************************
REM *** Clean-up any leftover files from previous run...
REM *** ...but keep the image listing, as it may already exist...

    if exist "!z_file_cli!"  del "!z_file_cli!"
    if exist "!z_file_fin!"  del "!z_file_fin!"
REM if exist "!z_file_ima!"  del "!z_file_ima!"
    if exist "!z_file_lis!"  del "!z_file_lis!"
    if exist "!z_file_tmp!"  del "!z_file_tmp!"


REM ***********************************************************************************
REM ***********************************************************************************
REM *** Collect list of all images...

call :log ""
call :log "Image listing..."

if exist "!z_file_ima!" (
  call :log "...image list already exists..."

) else (
  bpimagelist -idonly -d 01/01/1970 00:00:00 >"!z_file_ima!" 2>&1

  set z_sts=!errorlevel!

  if not !z_sts!==0 (
    call :log "...image listing failed, status `!z_sts!`, script aborting..."
    if exist "!z_file_ima!"  del "!z_file_ima!"
    goto :eof
  )
)

call :log "...done..."


REM ***********************************************************************************
REM ***********************************************************************************
REM *** Create list of unique client names...

call :log ""
call :log "Counting images and clients..."

set /a z_images=0
set /a z_clients=0

set z_client_curr=

for /f "tokens=1,2,3,4,5" %%a in ('type "!z_file_ima!"') do (
  set z_client_prev=!z_client_curr!

  set z_image=%%e

  set /a z_images+=1

  set z_client=
  if "!z_client!"=="" (if "!z_image:~-2,1!"=="_"  (set z_client=!z_image:~0,-2!))
  if "!z_client!"=="" (if "!z_image:~-3,1!"=="_"  (set z_client=!z_image:~0,-3!))
  if "!z_client!"=="" (if "!z_image:~-4,1!"=="_"  (set z_client=!z_image:~0,-4!))
  if "!z_client!"=="" (if "!z_image:~-5,1!"=="_"  (set z_client=!z_image:~0,-5!))
  if "!z_client!"=="" (if "!z_image:~-6,1!"=="_"  (set z_client=!z_image:~0,-6!))
  if "!z_client!"=="" (if "!z_image:~-7,1!"=="_"  (set z_client=!z_image:~0,-7!))
  if "!z_client!"=="" (if "!z_image:~-8,1!"=="_"  (set z_client=!z_image:~0,-8!))
  if "!z_client!"=="" (if "!z_image:~-9,1!"=="_"  (set z_client=!z_image:~0,-9!))
  if "!z_client!"=="" (if "!z_image:~-10,1!"=="_" (set z_client=!z_image:~0,-10!))
  if "!z_client!"=="" (if "!z_image:~-11,1!"=="_" (set z_client=!z_image:~0,-11!))

  if "!z_client!"=="" (
    call :log "...uexpected error, was not able to determine client name from image name `!z_image!`, script aborting..."
    goto :end
  )

  set z_client_curr=!z_client!

  if not "!z_client_curr!"=="!z_client_prev!" (
    (echo !z_client_curr!)>>"!z_file_cli!"

    set /a z_clients+=1
  )
)

call :log "...images found:   !z_images!"
call :log "...clients found:  !z_clients!"
call :log "...done..."


REM ***********************************************************************************
REM ***********************************************************************************
REM *** Prompt for regular expression search string...

set z_find_def=EXIT

:r_get_find

call :log ""
call :log ""

set z_find=

set /p z_find=!date! !time:~0,8!  _Enter a string to match against client names [EXIT]  : 

if "!z_find!"==""  set z_find=!z_find_def!

if /i "!z_find!"=="exit"  goto :eof


REM ***********************************************************************************
REM ***********************************************************************************
REM *** Search for partial/complete client name...

call :log ""
call :log "Searching for `!z_find!` within list of client names..."

findstr /i "!z_find!" "!z_file_cli!" >"!z_file_fin!" 2>&1

set z_sts=!errorlevel!

if not !z_sts!==0 (
  call :log "...did not find string in list of clients, try again..."
  goto :r_get_find
)

set /a z_clients_tot=0

for /f "tokens=*" %%a in ('type "!z_file_fin!"') do (set /a z_clients_tot+=1)

call :log "...matched string to `!z_clients_tot!` client names..."
call :log "...done..."


REM ***********************************************************************************
REM ***********************************************************************************
REM *** Create list of images for client names found...

call :log ""
call :log "Reporting clients and images found..."
call :log "   Count  Client                          Images  Oldest               Most Recent"
call :log "   -----  ------                          ------  ------               -----------"

set /a z_clients=0

for /f "tokens=*" %%a in ('type "!z_file_fin!"') do (
  set /a z_clients+=1

  set z_client=%%a

  bpclimagelist -client !z_client! -s 01/01/1970 00:00:00 -Listseconds >"!z_file_tmp!" 2>&1
  set z_sts=!errorlevel!
  if not !z_sts!==0 (
    call :log "...unexpected unable to re-list images for client `!z_client!`, status `!z_sts!`, script aborting..."
    goto :eof
  )

  call :lis ""
  call :lis "***********************************************************************************************"
  call :lis "***********************************************************************************************"
  call :lis "Client:  !z_client!"
  call :lis ""
  type "!z_file_tmp!" >>"!z_file_lis!"

  set /a z_images=0
  set z_oldest=
  set z_newest=

  for /f "tokens=1,2 skip=2" %%a in ('type "!z_file_tmp!"') do (
    set /a z_images+=1

    set z_image_date=%%a %%b
    if "!z_newest!"==""  set z_newest=!z_image_date!
  )

  set z_oldest=!z_image_date!

  set z_client_disp=!z_client!                              *
  set z_client_disp=!z_client_disp:~0,30!

  set z_clients_disp=      !z_clients!
  set z_clients_disp=!z_clients_disp:~-5!

  set z_images_disp=       !z_images!
  set z_images_disp=!z_images_disp:~-6!

  call :log "   !z_clients_disp!  !z_client_disp!  !z_images_disp!  !z_oldest!  !z_newest!"
)

call :lis ""
call :lis "***********************************************************************************************"
call :lis "***********************************************************************************************"

call :log "...done..."


REM ***********************************************************************************
REM ***********************************************************************************
REM *** Clean-up working files...

if exist "!z_file_cli!"  del "!z_file_cli!"
if exist "!z_file_fin!"  del "!z_file_fin!"
if exist "!z_file_tmp!"  del "!z_file_tmp!"

call :log ""
call :log "Report file created, contains list of images for client names matched..."
call :log "...filename:  !z_file_lis!"
call :log "...done..."


REM ***********************************************************************************
REM ***********************************************************************************
REM *** Script failures can also jump here...

:end
call :log ""
call :log "Script exiting..."
echo+
pause
exit /b


REM ***********************************************************************************
REM ***********************************************************************************
REM *** Logging and listing...

:log
(echo !date! !time:~0,8!  %~1)
(echo !date! !time:~0,8!  %~1)>>"!z_file_log!"
goto :eof

:lis
if "%~1"=="" (
  (echo+)>>"!z_file_lis!"
) else (
  (echo %~1)>>"!z_file_lis!"
)
goto :eof

HTH.

goldenret67
Level 3

Simply awseome!!!

thank you very much!!!

br

Ken

sdo
Moderator
Moderator
Partner    VIP    Certified
I forgot to add that the script above assumes that one has the NetBackup and admin binaries paths already pre-defined in the system wide PATH variable. I'll update it to detect paths and re-post, after this it should work on most systems.

Nicolai
Moderator
Moderator
Partner    VIP   

Please attach debug logs - and script, as attachments to a post :)