]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
Move ramdisk backup/restore to tmpfs initskript
authorArne Fitzenreiter <arne_f@ipfire.org>
Thu, 2 Oct 2008 05:41:52 +0000 (07:41 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Thu, 2 Oct 2008 05:41:52 +0000 (07:41 +0200)
config/cron/crontab
config/rootfiles/updater/update.sh
src/initscripts/init.d/collectd
src/initscripts/init.d/tmpfs

index 2d7552bedb789ace250c1f6dad3f3d4a1622861d..82d2e078fcde513d69bb4aa126fd0d1c486d2fdb 100644 (file)
@@ -22,7 +22,7 @@ HOME=/
 
 # Make some nice graphs
 */5 * * * *    /usr/local/bin/makegraphs >/dev/null
-* 05 * * *     /etc/init.d/collectd backup >/dev/null
+* 05 * * *     /etc/init.d/tmpfs backup >/dev/null
 
 # Force update the dynamic dns registration once a week
 # Force update even if IP has not changed once a month if 'minimize update' selected in GUI
index cfa6962f5e53180b9974f81677acaa03229ed158..95de204577efd2487a00c2fc882ea58ab4f6f078 100755 (executable)
@@ -172,7 +172,7 @@ echo \\n running on \\s \\r \\m >> /etc/issue
 #
 grep -v "ipacsum" /var/spool/cron/root.orig | grep -v "hddshutdown" > /tmp/root.orig.tmp
 echo "# Backup collectd files" >> /tmp/root.orig.tmp
-echo "* 05 * * *       /etc/init.d/collectd backup >/dev/null" >> /tmp/root.orig.tmp
+echo "* 05 * * *       /etc/init.d/tmpfs backup >/dev/null" >> /tmp/root.orig.tmp
 echo "# hddshutdown" >> /tmp/root.orig.tmp
 echo "*/30 * * * *     /usr/local/bin/hddshutdown >/dev/null" >> /tmp/root.orig.tmp
 mv /tmp/root.orig.tmp /var/spool/cron/root.orig
index a64114fb3821887979531dfaad8418051122b63b..2a0cd166637f162358781dbd581e5a6c89de3617 100644 (file)
@@ -43,7 +43,7 @@ case "$1" in
        stop)
                # Save the ramdisk at manual stop but not at shutdown
                if [ "$(basename $0)" == "collectd" ]; then
-                   /etc/init.d/collectd backup
+                   /etc/init.d/tmpfs backup
                fi
                boot_mesg "Stopping Collection daemon..."
                killproc /usr/sbin/collectd
@@ -54,17 +54,6 @@ case "$1" in
                sleep 1
                ${0} start
                ;;
-       backup)
-               boot_mesg "Save rrd files from ramd..."
-               cp -pR $RRDLOG/* $RRDLOG.bak/
-               evaluate_retval
-               ;;
-       restore)
-               if [ -e $RRDLOG.bak ];then
-                       boot_mesg "Copying rrd files to ramd..."
-                       cp -pR $RRDLOG.bak/* $RRDLOG/
-               fi
-               ;;
        status)
                statusproc /usr/sbin/collectd
                ;;
index 4a1ae15cadcb75ec60b96e8a53289e7f0aebb5f0..d274176286b4717a42f972a63ad4d6e753765fe7 100644 (file)
@@ -1,7 +1,6 @@
 #!/bin/sh
 # Begin $rc_base/init.d/tmpfs
 
-
 . /etc/sysconfig/rc
 . $rc_functions
 
@@ -13,17 +12,30 @@ fi
 
 case "$1" in
        start)
-               /etc/init.d/collectd restore
+               $0 restore
                if [ ! -e $RRDLOG.bak/vnstat ]; then
                        mkdir -p $RRDLOG.bak/vnstat
                fi
                ;;
        stop)
-               /etc/init.d/collectd backup
+               $0 backup
+               ;;
+
+       backup)
+               boot_mesg "Save ramdisk..."
+               cp -pR $RRDLOG/* $RRDLOG.bak/
+               evaluate_retval
                ;;
+       restore)
+               if [ -e $RRDLOG.bak ];then
+                       boot_mesg "Restore ramdisk..."
+                       cp -pR $RRDLOG.bak/* $RRDLOG/
+               fi
+               ;;
+
 
        *)
-               echo "Usage: $0 {start|stop}"
+               echo "Usage: $0 {start|stop|backup}"
                exit 1
                ;;
 esac