diff options
author | Phil Davis <phil.davis@world.inf.org> | 2012-04-23 14:54:38 +0545 |
---|---|---|
committer | Phil Davis <phil.davis@world.inf.org> | 2012-04-23 14:54:38 +0545 |
commit | 6a7b35ea4f6c1319ab0c25950f75ad307e699ba9 (patch) | |
tree | a16501cc64cf6836a57471550878fea1abdb96fe /etc/inc | |
parent | 905ea3368c012fc4b1be66f8d8efd62f7b09ae66 (diff) | |
download | pfsense-6a7b35ea4f6c1319ab0c25950f75ad307e699ba9.zip pfsense-6a7b35ea4f6c1319ab0c25950f75ad307e699ba9.tar.gz |
Delete any existing /var/db/rrd/*.rrd files before restoring from the XML
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/rrd.inc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/etc/inc/rrd.inc b/etc/inc/rrd.inc index 5294075..ef79a37 100644 --- a/etc/inc/rrd.inc +++ b/etc/inc/rrd.inc @@ -66,6 +66,9 @@ function restore_rrd() { } foreach (glob("{$rrddbpath}/*.xml") as $xml_file) { $rrd_file = preg_replace('/\.xml$/', ".rrd", $xml_file); + if (file_exists("{$rrd_file}")) { + unlink($rrd_file); + } exec("$rrdtool restore '{$xml_file}' '{$rrd_file}'"); unlink($xml_file); } |