Video Screencast Help
Symantec to Separate Into Two Focused, Industry-Leading Technology Companies. Learn more.

bplist does not display the year of a backup?

Created: 10 Jun 2009 • Updated: 22 May 2010 | 15 comments
This issue has been solved. See solution.

Hey guys,

I'm trying to use the 'bplist' command to automate restoring data via a script.

bplist works fine, and returns the backup entries, but it does not include the year the backup ran - only the month, day and hour.

here's some example output:

root@ndmpmaster:/ > bplist -C gx03 -t 19 -B -l -b '/dd/v6'
drwxrws--- root cgi 4096 Jun 10 08:38 /dd/v6/
drwxrws--- root cgi 4096 Jun 05 00:10 /dd/v6/
drwxrws--- root cgi 4096 Jun 04 00:36 /dd/v6/

does anyone know how to get the year associated with these backups?

Comments 15 CommentsJump to latest comment

Nicolai's picture

Is bpclimagelist  what you are looking for ? It returns backup and expiration date.

Example output:

# ./bpclimagelist -client kohala -s 06/01/2009

Backed Up                 Expires        Files         KB         C Sched Type        Policy
---------------- ---------- -------- ----------- - ------------ ------------
06/10/2009 21:53 07/11/2009 741971 145024222 N Cinc Backup UNIX_FS_NN
06/09/2009 21:01 07/10/2009 644495 143857113 N Cinc Backup UNIX_FS_NN
06/08/2009 18:29 07/09/2009 612011 202299902 N Cinc Backup UNIX_FS_NN
06/07/2009 21:46 07/08/2009 500823 201046263 N Cinc Backup UNIX_FS_NN
06/06/2009 23:32 07/07/2009 386527 199300012 N Cinc Backup UNIX_FS_NN
06/06/2009 02:36 07/07/2009 246862 195213725 N Cinc Backup UNIX_FS_NN
06/04/2009 19:58 09/05/2009 12432902 1493947027 N Full Backup UNIX_FS_NN
06/04/2009 02:07 07/05/2009 452173 195927746 N Cinc Backup UNIX_FS_NN
06/02/2009 21:58 07/03/2009 349927 134378166 N Cinc Backup UNIX_FS_NN
06/01/2009 22:06 07/02/2009 318122 124994431 N Cinc Backup UNIX_FS_NN

Assumption is the mother of all mess ups.

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

altmiket's picture

thanks for the reply Nicolai!

unfortunately i'm looking to scan for individual paths for a restore, so bpclimagelist won't work for me.

Karthikeyan Sundaram's picture

you have to use the -s and -e switches to show the files backed up before 6 months !

-s specifies a start date and time for the listing. The resulting list shows only files in backups or the archives that occurred at or after the specified date and time.

The valid range of dates is from 01/01/1970 00:00:00 to 01/19/2038 03:14:07. "The default is the current date minus six months. "

-e specifies an end date and time for the listing. The resulting list shows only files from the backups or the archives that occurred at or before the specified date and time. Use the same format for start date and time. The default is the current date and time.

Thanks, Karthikeyan Sundaram.

SOLUTION
altmiket's picture

thank you for the info Karthlkeyan!

this is good to know - i didn't realize that bplist would default to just 6 months.

i guess there might be some way i can run repeated instances of bplist, passing in date ranges, going back in time, to be able to figure out the year of a backup.

however that info is surely in the netbackup database somewhere, it's just not being displayed, which is a bummer.

i think i'll put something in the 'ideas' section of the support site, and maybe they can update bplist to display the year properly.

thanks again

Stumpr2's picture

There is a misconception in this thread the " -l " in the bplist command does not tell you when the backup ran. It tells you when the file was last modified. If the last modified time is less than six months then it shows the hours/minutes. If the file has been static for over six monthe then it will show the day/year.

VERITAS ain't it the truth?

altmiket's picture

from the bplist man page:

 -b | -c | -u

Specifies an alternate date and time to be used
for printing with the -l option:
-b displays the backup date and time of each file.

-c displays the last inode modification date and
time for each file.
-u displays the last access date and time of each
file.
The default is to display the time of the last
modification of each file.

so i am using both the -b and -l flags to emit the backup time of a file from bplist, which i then want to use that date/time to feed into bprestore and invoke a restore.

i don't believe that the date format is changing when the backup time is over 6 months old, and including the year.

altmiket's picture

ok, so it does indeed look like the hour field changes to a year, if the backup is over 6 months old.

my code was ignoring the hours/mintues field completely, and i didn't expect veritas to swap a field around like that (though i guess i should, given what i've seen so far, and how they fiddle with date fields based on various combinations of flags being passed in)

i guess i have to work up some logic to parse the "time or year" field and act accordingly.

i wish they'd just stick the year in there and be done with it.

thanks everyone.

Darren Dunham's picture

my code was ignoring the hours/mintues field completely, and i didn't expect veritas to swap a field around like that (though i guess i should, given what i've seen so far, and how they fiddle with date fields based on various combinations of flags being passed in)

This is the traditional timestamp display format for 'ls'.  For better or worse, 'bplist' is just copying that format.

--
Darren

Stumpr2's picture

WRONG---> ok, so it does indeed look like the hour field changes to a year, if the backup is over 6 months old.

the time/date has zero to do with the backup date and time.
the time/date has ALL to do with the file modification date and time.

VERITAS ain't it the truth?

altmiket's picture

then what does 'bplist -b -l' do?

is the man page inaccurate?

altmiket's picture

here you go:

root@ndmpmaster:/ > ls -ld /dd/dept/syseng/miket
drwxrws--- 56 miket cgi 8192 May  8 16:44 /dd/dept/syseng/miket

root@ndmpmaster:/ > bplist -C gx03 -t 19 -B -l  '/dd/v6/miket'
drwxrws--- miket     cgi              8192 May 08 16:44 /dd/v6/miket/
drwxrws--- miket     cgi              8192 May 08 16:44 /dd/v6/miket/
drwxrws--- miket     cgi              8192 May 08 16:44 /dd/v6/miket/
drwxrws--- miket     cgi              8192 May 08 16:44 /dd/v6/miket/
drwxrws--- miket     cgi              8192 May 08 16:44 /dd/v6/miket/

root@ndmpmaster:/ > bplist -C gx03 -t 19 -B -l -b  '/dd/v6/miket'
drwxrws--- miket     cgi              8192 Jun 10 08:38 /dd/v6/miket/
drwxrws--- miket     cgi              8192 Jun 05 00:10 /dd/v6/miket/
drwxrws--- miket     cgi              8192 Jun 04 00:36 /dd/v6/miket/
drwxrws--- miket     cgi              8192 Jun 02 02:06 /dd/v6/miket/
drwxrws--- miket     cgi              8192 May 31 06:06 /dd/v6/miket/
(the volume v6 maps to /dd/dept/syseng in NFS space in this example)


Stumpr2's picture

You are correct that the" -b " reveals  backup date/time stamp.
Note that it is used With the " -l " option.
Here is the difference with a static file over a few years span.

First the " -l " option shows the same date for this static file
# bplist -l -s 01/01/2000 -e 05/12/2009 /etc/issue
-r--r--r-- root root 1090 Sep 27 2005 /etc/issue
-r--r--r-- root root 1090 Sep 27 2005 /etc/issue
-r--r--r-- root root 1090 Sep 27 2005 /etc/issue
-r--r--r-- root root 1090 Sep 27 2005 /etc/issue
-r--r--r-- root root 1090 Sep 27 2005 /etc/issue
-r--r--r-- root root 1090 Sep 27 2005 /etc/issue
-r--r--r-- root root 1090 Sep 27 2005 /etc/issue
-r--r--r-- root root 1090 Sep 27 2005 /etc/issue
-r--r--r-- root root 1090 Sep 27 2005 /etc/issue
-r--r--r-- root root 1090 Sep 27 2005 /etc/issue
-r--r--r-- root root 1090 Sep 27 2005 /etc/issue
-r--r--r-- root root 1090 Sep 27 2005 /etc/issue
-r--r--r-- root root 1090 Sep 27 2005 /etc/issue
-r--r--r-- root root 1090 Sep 27 2005 /etc/issue
-r--r--r-- root root 1090 Sep 27 2005 /etc/issue
-r--r--r-- root root 1090 Sep 27 2005 /etc/issue
-r--r--r-- root root 1090 Sep 27 2005 /etc/issue
-r--r--r-- root root 1090 Sep 27 2005 /etc/issue
-r--r--r-- root root 1090 Sep 27 2005 /etc/issue
-r--r--r-- root root 1090 Sep 27 2005 /etc/issue
-r--r--r-- root root 1090 Sep 27 2005 /etc/issue
-r--r--r-- root root 1090 Sep 27 2005 /etc/issue
-r--r--r-- root root 1090 Sep 27 2005 /etc/issue
-r--r--r-- root root 1090 Sep 27 2005 /etc/issue
-r--r--r-- root root 1090 Sep 27 2005 /etc/issue

Now if you add the " -b" option you see that the date/time changes to match the backup time
Notice that the date/time changes to day/month/year format after 6 months.
You have to use the " -b" option to see the backup time as the " -l" option has nothing to do with backup time.
# bplist -b -l -s 01/01/2000 -e 05/12/2009 /etc/issue
-r--r--r-- root root 1090 May 11 10:00 /etc/issue
-r--r--r-- root root 1090 May 04 10:00 /etc/issue
-r--r--r-- root root 1090 Apr 27 10:00 /etc/issue
-r--r--r-- root root 1090 Apr 20 10:00 /etc/issue
-r--r--r-- root root 1090 Apr 13 10:00 /etc/issue
-r--r--r-- root root 1090 Mar 30 10:00 /etc/issue
-r--r--r-- root root 1090 Mar 02 10:00 /etc/issue
-r--r--r-- root root 1090 Feb 01 01:16 /etc/issue
-r--r--r-- root root 1090 Jan 26 12:11 /etc/issue
-r--r--r-- root root 1090 Dec 29 10:00 /etc/issue
-r--r--r-- root root 1090 Dec 01 2008 /etc/issue
-r--r--r-- root root 1090 Nov 03 2008 /etc/issue
-r--r--r-- root root 1090 Oct 14 2008 /etc/issue
-r--r--r-- root root 1090 Oct 06 2008 /etc/issue
-r--r--r-- root root 1090 Sep 25 2008 /etc/issue
-r--r--r-- root root 1090 Sep 25 2008 /etc/issue
-r--r--r-- root root 1090 Sep 22 2008 /etc/issue
-r--r--r-- root root 1090 Sep 19 2008 /etc/issue
-r--r--r-- root root 1090 Sep 08 2008 /etc/issue
-r--r--r-- root root 1090 Aug 11 2008 /etc/issue
-r--r--r-- root root 1090 Aug 07 2008 /etc/issue
-r--r--r-- root root 1090 Jul 14 2008 /etc/issue
-r--r--r-- root root 1090 Jul 14 2008 /etc/issue
-r--r--r-- root root 1090 Jun 16 2008 /etc/issue
-r--r--r-- root root 1090 May 02 2007 /etc/issue

VERITAS ain't it the truth?

altmiket's picture

Bob i'm guessing your web browser is truncating the original bplist command I submitted, because you're repeating pretty much exactly what I've detailed above.

i noticed that safari is not showing the full contents of the pre-formatted code i pasted in my original post, which i'm guessing is maybe why you thought i wasn't using the -b and -l flags all along.

anyway, sorry for the confusion.

Will Restore's picture

-l  shows mod date
-b -l  shows backup date

bplist shows the year OR the time
GUI shows the year AND the time (and both backup and mod dates)

Will Restore -- where there is a Will there is a way

Karthikeyan Sundaram's picture

Mark my comments as solutio if you are satified with my comments :)

Thanks, Karthikeyan Sundaram.