Exporting BGP fullview RIB

Hello all,

I’m looking for a solution to export the full RIB (~400000 routes) with details.
I tried with :

ssh admin@host -C "/ip route print details" > ipv4routes.txt

but it disconnect after 60 seconds and I get only ~20% of the route list (I tried many times, from many different connections)

I also tried to export to file and then scp but 128MB is not enough to store everything.

Can you think of anything that I could try ? I only have access through SSH.

Thank you in advance.