[NEXUS 3.5] How to check storage usage inside a hosted repository?

2,286 views
Skip to first unread message

Carlo Reggiani

unread,
Sep 18, 2017, 4:44:00 AM9/18/17
to Nexus Users
I'm looking for any information about storage space used by a specific artifact in a hosted repository in a blob store...

Nexus 2 was easy to check storage usage using simple "du" command in folder tree, but now with a single blob store file?

In the [Nexus 3.5] UI it seems a missing information.

Thanks for any idea

Carlo

Mariska Hoogenboom

unread,
Sep 18, 2017, 6:14:50 AM9/18/17
to Nexus Users

Hi,

 

You could do something like:

 

File nexus-bigfiles

#!/bin/bash

size=$1

big_files_list=$(find . -name \*.bytes -type f -printf "%b %h/%f\n" |

                awk -v size="$size" '

                                function basename(file) {

                                                sub(".bytes$", ".properties", file)

                                                return file

                                                }

                                {if ($1 > size) {

                                                print basename($2) }}')

for i in ${big_files_list}; do

                grep -E 'size|BlobStore.blob-name' $i

done

 

Usage:

$ cd nexus-data/blobs

$ nexus-bigfiles 10000

 

This will give you a list of all artifacts with size > 10000.

 

Probably you could setup something more elegant, but this will do the trick. Note, this will only work with the current file based blobstorage.

 

Met vriendelijke groet/Kind regards,


Mariska Hoogenboom

--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users...@glists.sonatype.com.
To post to this group, send email to nexus...@glists.sonatype.com.
To view this discussion on the web visit https://groups.google.com/a/glists.sonatype.com/d/msgid/nexus-users/468fa564-72b3-4da3-a45a-f32fb1b188ae%40glists.sonatype.com.
For more options, visit https://groups.google.com/a/glists.sonatype.com/d/optout.



CCV disclaimer


Carlo Reggiani

unread,
Sep 18, 2017, 9:36:08 AM9/18/17
to Mariska Hoogenboom, Nexus Users
Good starting point, Mariska!

Thanks

I'll try to create a tailored script to replicate the "du -h" totals for a specifi folder

Carlo

To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users+unsubscribe@glists.sonatype.com.

You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users+unsubscribe@glists.sonatype.com.

To post to this group, send email to nexus...@glists.sonatype.com.
Reply all
Reply to author
Forward
0 new messages