1
|
#!/bin/sh
|
2
|
|
3
|
: ${RRDDBPATH:=/var/db/rrd}
|
4
|
: ${CF_CONF_PATH:=/cf/conf}
|
5
|
|
6
|
# Save the rrd databases to the config path.
|
7
|
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
|
fi
|
17
|
|