Commit 58c923b7 authored by Franco Fichtner's avatar Franco Fichtner

backup: simple rrd backup, xml export done elsewhere #909

parent 1586ee02
...@@ -5,22 +5,10 @@ BACKUPFILE="/conf/rrd.tgz" ...@@ -5,22 +5,10 @@ BACKUPFILE="/conf/rrd.tgz"
if [ "${1}" == "restore" ]; then if [ "${1}" == "restore" ]; then
if [ -f "${BACKUPFILE}" ]; then if [ -f "${BACKUPFILE}" ]; then
rm -f "${BACKUPDIR}"/*.xml
tar -C / -xzf "${BACKUPFILE}" tar -C / -xzf "${BACKUPFILE}"
for XML in "${BACKUPDIR}"/*.xml; do
RRD="${XML%.xml}.rrd"
rm -f "${RRD}"
/usr/local/bin/rrdtool restore -f "${XML}" "${RRD}"
done
rm -f "${BACKUPDIR}"/*.xml
fi fi
else else
if [ -d "${BACKUPDIR}" ]; then if [ -d "${BACKUPDIR}" ]; then
for RRD in "${BACKUPDIR}"/*.rrd; do tar -C / -czf "${BACKUPFILE}" "${BACKUPDIR}"
XML="${RRD%.rrd}.xml"
/usr/local/bin/rrdtool dump "${RRD}" "${XML}"
done
tar -C / -czf "${BACKUPFILE}" "${BACKUPDIR}"/*.xml
rm -f "${BACKUPDIR}"/*.xml
fi fi
fi fi
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