I wrote a script to solve the problem.
It compares the known deployments returned by CLI (hash attribute) with the files stored in the content directory.
Therefore, you can guess if the hash belongs to a deployed application or not.
Then, you can purge the failed deployments in the content and servers directories on the master and the slave machines.
If someone is interested, i can bring more details.
It can save a lot of space on the disk, especially for a development platform.
Can you share the script, I have 5 valid deployments, but I'm seeing many more under my ./data/content directory which must be from failed deployments which are consuming around 20GB of space