Project

General

Profile

Download (490 Bytes) Statistics
| Branch: | Tag: | Revision:
1 ef68d19c jim-p
#!/bin/sh
2
3 8bdb6879 Darren Embry
: ${RRDDBPATH:=/var/db/rrd}
4
: ${CF_CONF_PATH:=/cf/conf}
5
6 ef68d19c jim-p
# Save the rrd databases to the config path.
7 8bdb6879 Darren Embry
if [ -d "${RRDDBPATH}" ]; then
8
	[ -z "$NO_REMOUNT" ] && /etc/rc.conf_mount_rw
9
	for rrdfile in "${RRDDBPATH}"/*.rrd ; do
10
		xmlfile="${rrdfile%.rrd}.xml"
11
		/usr/bin/nice -n20 /usr/local/bin/rrdtool dump "$rrdfile" "$xmlfile"
12
	done
13
	cd / && tar -czf "${CF_CONF_PATH}"/rrd.tgz -C / "${RRDDBPATH#/}"/*.xml
14
	rm "${RRDDBPATH}"/*.xml
15
	[ -z "$NO_REMOUNT" ] && /etc/rc.conf_mount_ro
16 e9b0bcf7 Ermal
fi