We have a fairly complex system that runs multiple ANT builds simultaneously on a number of *nix PCs. We think that there are times when the disks fill up just before the clean up scripts run and/or the load on the PC is sufficiently high to cause issues when connecting to external servers (signing servers etc).
What we want is every 2 minutes to log the output of something like this to a file :
df . --direct -P --block-size=1m | tail -n 1 | awk {'printf("Free %dMb (%d%% Full)\t", $4, $5)'}; uptime
Is this possible in ANT (or ANT-contrib) or will I have to execute an external script?
My best solution so far is:
<target name="my_target">
<parallel>
<exec ... pc_status_every_2_mins_logger.sh />
<sequential>
... rest of very large ANT script ...
</sequential>
</parallel>
</target>
I think this is rather clumsy and hoped that ant might have a much cleaner way to deal with this kind of issue.
You may try the other way around – means not checking how much space but checking if there is enough space – and use the hasfreespace condition (since Ant 1.7.0)