cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the size of a folder on an image backup?

Vinicius
Level 3

Hello,

 

I would like to restore a folder, but I would like to know the size of this folder prior to restore because of the quota on destination. Is it possible, please?

 

Any tips, please?

 

TIA,

cviniciusm.

4 REPLIES 4

Stumpr2
Level 6

Netbackup does not have this feature. sorry.

 

Rakesh_Khandelw
Level 6

There is no straight forward way. If you are restoring the whole policy/stream, then you can list the image using bpimagelist command and count how many fragments you have and multiply it with your Fragment size. This can give you idea about the size but keep in mind you this is good only if you are restoring the whole image or else you can use "bplist" command and list the files and then add the bytes for each file you need. In other way run bplist against the client, date and filesystem/directory redirect o/p to a file and then awk on size field and add those numbers.

 

e.g. for a unix client-

 

# bplist -B -C <client_name> -t 0  -R -u -l -s 07/10/2008 -e 07/11/2008 / > /tmp/1 (running list from / )

# awk '{print $4}' /tmp/1 > /tmp/2 (this will show the byte size)

 

now you can take these numbers to excel and do the sum or whichever other way you prefer.

 

 

 

 

Omar_Villa
Level 6
Employee

Unix can do the sum for you, taked from the last output:

 

e.g. for a unix client-

 

# bplist -B -C <client_name> -t 0  -R -u -l -s 07/10/2008 -e 07/11/2008 / > /tmp/1 (running list from / )

# awk '{print $4}' /tmp/1 > /tmp/2 (this will show the byte size)

 

# awk '{SUM += $4} END{print SUM/1024/1024}'

 

this last line will give you the total of bytes in MB.

 

regards

Anton_Panyushki
Level 6
Certified

We were asked to restore folders that include a date in their names. 

We did this via shell script

 

#!/usr/bin/ksh
for bkdate in `cat /space/dates`
do
    bksize=`bplist -C client_name -s 01/01/2004 -e 12/31/2005  -l -R /RUN/files/INPUT/ARCHV_DIR/$bkdate/TAP3 | awk {'print $4'}`
    i=0
    for sz in $bksize
    do
       (( i = i + sz ))
    done
    print "$bkdate, $i" >> /tmp/calc
done