This article explains how to clean up /var and /var/log partitions before the upgrade via Junos space
It uses the Slax script to run the command "request system storage cleanup no-confirm" on multiple devices.
Here are the steps to achieve this: