On a GNU system, you could do something like:
cd /var/log/hive &&
find . -type f -printf '%T@ %b :%p\0' |
sort -zrn |
gawk -v RS='\0' -v ORS='\0' '
BEGIN {max = 10 * 1024 * 1024 * 1024} # 10GiB; use max=10e9 for 10GB
{du += 512 * $2}
du > max {
sub("[^:]*:", ""); print
}' | xargs -r0 echo rm -f
That is sort the regular files by last modification time (from newest to oldest), then count their cumulative disk usage (here assuming there are no hard links) and delete every file when we've passed the 10GiB threshold.
Note that it doesn't take into account the size of the directory files themselves. It only considers the disk usage of regular files.
Remove echo
when satisfied with the result.
On one line:
find . -type f -printf '%T@ %b :%p\0' |sort -zrn|gawk -vRS='\0' -vORS='\0' '{du+=512*$2};du>10*(2^30){sub("[^:]*:","");print}'|xargs -r0 echo rm -f
To delete only *.wsp files when the cumulative disk usage of all regular files goes over 10GiB, you'd want to list the non-wsp files first. And at the same time, we can also account for the disk usage of directories and other non-regular files we were missing earlier:
cd /var/log/hive &&
find . \( -type f -name '*.wsp' -printf WSP -o -printf OTHER \) \
-printf ' %T@ %b :%p\0' |
sort -zk 1,1 -k2,2rn |
gawk -v RS='\0' -v ORS='\0' '
BEGIN {max = 10 * 1024 * 1024 * 1024} # 10 GiB
{du += 512 * $3}
du > max && $1 == "WSP" {
sub("[^:]*:", ""); print
}' | xargs -r0 echo rm -f