pfsense/pfsense — pull request #1354 by phil-davis (2014-11-28 17:39:48+00:00)
Title: Process RRD backup compression in var

Prior to this the RRD xml files were added uncompressed to the archive in /cf/conf and then that archive was compressed at the end.
My /cf partition is only 50MB. The uncompressed archive of all the xml files is already 35MB. With a few config backups, or a few more VLANs (xml files) I will soon run into the 50MB limit.
This change creates each xml from rrd one at a time, then compresses that 1 xml into a tgz in /var/db/rrd, deletes the xml then loops to the next rrd file.
At the end of the loop, there are a bunch of /var/db/rrd/*.tgz files, which are small (they take up <2MB on my system, from XMLs that total 35MB). They are then unpacked and put into 1 /cf/conf/rrd.tgz in a single command.
Thus there is no time when 35MB of xml content has to be stored anywhere.
This should work for systems with a lot of RRD files that turn into XML and then TGZ one at a time.