From ef68d19ce1ec4c6f23c6e350340ccb7e6a2448d7 Mon Sep 17 00:00:00 2001 From: jim-p Date: Fri, 6 Aug 2010 12:03:03 -0400 Subject: Move the RRD backup code to a script. --- etc/rc.backup_rrd.sh | 6 ++++++ etc/rc.reboot | 5 +---- etc/rc.shutdown | 5 +---- 3 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 etc/rc.backup_rrd.sh (limited to 'etc') diff --git a/etc/rc.backup_rrd.sh b/etc/rc.backup_rrd.sh new file mode 100644 index 0000000..2e93b64 --- /dev/null +++ b/etc/rc.backup_rrd.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +# Save the rrd databases to the config path. +/etc/rc.conf_mount_rw +cd / && tar -czf /cf/conf/rrd.tgz -C / var/db/rrd/*.rrd +/etc/rc.conf_mount_ro diff --git a/etc/rc.reboot b/etc/rc.reboot index 66efae4..ff5a5fc 100755 --- a/etc/rc.reboot +++ b/etc/rc.reboot @@ -15,10 +15,7 @@ PLATFORM=`cat /etc/platform` if [ "$PLATFORM" = "pfSense" ]; then rm -rf /tmp/* else - /etc/rc.conf_mount_rw - # Save the rrd databases to the config path. - cd / && tar -czf /cf/conf/rrd.tgz -C / var/db/rrd/*.rrd - /etc/rc.conf_mount_ro + /etc/rc.backup_rrd.sh fi sleep 1 diff --git a/etc/rc.shutdown b/etc/rc.shutdown index f6175b4..7d4d32f 100755 --- a/etc/rc.shutdown +++ b/etc/rc.shutdown @@ -30,8 +30,5 @@ PLATFORM=`cat /etc/platform` if [ "$PLATFORM" = "pfSense" ]; then rm -rf /tmp/* else - /etc/rc.conf_mount_rw - # Save the rrd databases to the config path. - cd / && tar -czf /cf/conf/rrd.tgz -C / var/db/rrd/*.rrd - /etc/rc.conf_mount_ro + /etc/rc.backup_rrd.sh fi -- cgit v1.1