Revision e34cf1f6
Added by Seth Mos almost 14 years ago
| etc/inc/upgrade_config.inc | ||
|---|---|---|
| 1936 | 1936 |
|
| 1937 | 1937 |
$rrddbpath = "/var/db/rrd/"; |
| 1938 | 1938 |
$rrdtool = "/usr/bin/nice -n20 /usr/local/bin/rrdtool"; |
| 1939 |
if ($g['platform'] != "pfSense") {
|
|
| 1940 |
/* restore the databases, if we have one */ |
|
| 1941 |
if (file_exists("{$g['cf_conf_path']}/rrd.tgz")) {
|
|
| 1942 |
exec("cd /;LANG=C /usr/bin/tar -xzf {$g['cf_conf_path']}/rrd.tgz 2>&1", $rrdrestore, $rrdreturn); $rrdrestore = implode(" ", $rrdrestore);
|
|
| 1943 |
if($rrdreturn <> 0) {
|
|
| 1944 |
log_error("RRD restore failed exited with $rrdreturn, the error is: $rrdrestore\n");
|
|
| 1945 |
} |
|
| 1946 |
/* Make sure to move the rrd backup out of the way. We will make a new one after converting. */ |
|
| 1947 |
exec("/bin/mv {$g['cf_conf_path']}/rrd.tgz /root/");
|
|
| 1948 |
} |
|
| 1949 |
} |
|
| 1939 | 1950 |
|
| 1940 | 1951 |
$rrdinterval = 60; |
| 1941 | 1952 |
$valid = $rrdinterval * 2; |
| ... | ... | |
| 2049 | 2060 |
|
| 2050 | 2061 |
} |
| 2051 | 2062 |
enable_rrd_graphing(); |
| 2063 |
/* Let's save the RRD graphs after we run enable RRD graphing */ |
|
| 2064 |
/* The function will restore the rrd.tgz so we will save it after */ |
|
| 2065 |
exec("cd /;LANG=C /usr/bin/tar -czf {$g['cf_conf_path']}/rrd.tgz -C / var/db/rrd/*.rrd");
|
|
| 2052 | 2066 |
if ($g['booting']) |
| 2053 | 2067 |
echo "Updating configuration..."; |
| 2054 | 2068 |
} |
Also available in: Unified diff
Restore the RRD backup before attempting a migration as this bites the nanobsd users.
We immediately backup the new databases to a new rrd.tgz file. The old database will be moved to /root
Fix for ticket #1758