Commit ce4bb4e7 authored by Franco Fichtner's avatar Franco Fichtner

backup: remove unused env var and add netflow script

parent 84416c71
......@@ -2125,8 +2125,7 @@ function upgrade_054_to_055()
enable_rrd_graphing();
/* Let's save the RRD graphs after we run enable RRD graphing */
/* The function will restore the rrd.tgz so we will save it after */
exec("cd /; LANG=C NO_REMOUNT=1 RRDDBPATH='{$rrddbpath}' CF_CONF_PATH='/conf' /usr/local/etc/rc.backup_rrd");
mwexec('/bin/rm /var/db/rrd/*.xml');
exec("cd /; LANG=C RRDDBPATH='{$rrddbpath}' CF_CONF_PATH='/conf' /usr/local/etc/rc.backup_rrd");
if (file_exists("/var/run/booting")) {
echo "Updating configuration...";
}
......@@ -2790,7 +2789,7 @@ function upgrade_080_to_081()
enable_rrd_graphing();
/* Let's save the RRD graphs after we run enable RRD graphing */
/* The function will restore the rrd.tgz so we will save it after */
exec("cd /; LANG=C NO_REMOUNT=1 RRDDBPATH='{$rrddbpath}' CF_CONF_PATH='/conf' /usr/local/etc/rc.backup_rrd");
exec("cd /; LANG=C RRDDBPATH='{$rrddbpath}' CF_CONF_PATH='/conf' /usr/local/etc/rc.backup_rrd");
if (file_exists("/var/run/booting"))
echo "Updating configuration...";
foreach($config['filter']['rule'] as & $rule) {
......@@ -3096,7 +3095,7 @@ function upgrade_095_to_096()
enable_rrd_graphing();
/* Let's save the RRD graphs after we run enable RRD graphing */
/* The function will restore the rrd.tgz so we will save it after */
exec("cd /; LANG=C NO_REMOUNT=1 RRDDBPATH='{$rrddbpath}' CF_CONF_PATH='/conf' /usr/local/etc/rc.backup_rrd");
exec("cd /; LANG=C RRDDBPATH='{$rrddbpath}' CF_CONF_PATH='/conf' /usr/local/etc/rc.backup_rrd");
}
function upgrade_096_to_097()
......
......@@ -184,6 +184,9 @@ echo "done."
# Execute the early syshook / plugin commands
/usr/local/etc/rc.syshook early
# Restore backups from previous shutdown (if any)
/usr/local/etc/rc.backup_netflow restore
# let the PHP-based configuration subsystem set up the system now
echo -n "Launching the init system..."
rm -f /root/lighttpd*
......
#!/bin/sh
BACKUPFILE="/conf/netflow.tgz"
BACKUPDIR="/var/netflow"
if [ "${1}" == "restore" ]; then
if [ -f "${BACKUPFILE}" ]; then
tar -C / -xzf "${BACKUPFILE}"
fi
else
if [ -d "${BACKUPDIR}" ]; then
tar -C / -czf "${BACKUPFILE}" "${BACKUPDIR}"
fi
fi
......@@ -11,6 +11,7 @@
# backup volatile internals
/usr/local/etc/rc.backup_dhcpleases
/usr/local/etc/rc.backup_netflow
/usr/local/etc/rc.backup_rrd
# wait for config lock to release
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment