###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2007-2024 IPFire Team <info@ipfire.org> #
+# Copyright (C) 2007-2025 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
restore_backup() {
local filename="${1}"
+ # stop collectd to remove the rrd ramdisk for restore and convert
+ # the rrd's
+ /etc/rc.d/init.d/collectd stop
+
# remove all openvpn certs to prevent old unusable
# certificates being left in directory after a restore
rm -f /var/ipfire/ovpn/certs/*
# be empty after the migration has been carried out.
/var/ipfire/collectd-migrate-4-to-5.pl --indir /var/log/rrd/ > /tmp/rrd-migrate.sh
sh /tmp/rrd-migrate.sh >/dev/null 2>&1
- if [ -d /var/log/rrd/collectd/localhost/interface/ ]; then
- rm -Rf /var/log/rrd/collectd/localhost/interface/
- fi
+ rm -rf \
+ /var/log/rrd/collectd/localhost/cpufreq
+ /var/log/rrd/collectd/localhost/interface
+ /var/log/rrd/collectd/localhost/thermal-thermal_zone*/temperatur-temperatur.rrd
+
+ # start collectd after restore
+ /etc/rc.d/init.d/collectd start
return 0
}
done
# Stop services
+/etc/rc.d/init.d/collectd stop
KVER="xxxKVERxxx"
# Filesytem cleanup
/usr/local/bin/filesystem-cleanup
-# Start services
-/etc/init.d/suricata restart
-
# Create collectd 4.x to 5.x migration script from rrd contents, run the script that
# was created and then remove the old interface directory if it is present as it will
# be empty after the migration has been carried out.
/var/ipfire/collectd-migrate-4-to-5.pl --indir /var/log/rrd/ > /tmp/rrd-migrate.sh
sh /tmp/rrd-migrate.sh >/dev/null 2>&1
-if [ -d /var/log/rrd/collectd/localhost/interface/ ]; then
- rm -Rf /var/log/rrd/collectd/localhost/interface/
-fi
+ rm -rf \
+ /var/log/rrd/collectd/localhost/cpufreq
+ /var/log/rrd/collectd/localhost/interface
+ /var/log/rrd/collectd/localhost/thermal-thermal_zone*/temperatur-temperatur.rrd
+
+# Start services
+/etc/init.d/collectd start
+/etc/init.d/suricata restart
# Build initial ramdisks
dracut --regenerate-all --force