diff --git a/configure.ac b/configure.ac index fb59c35aa..17fa00857 100644 --- a/configure.ac +++ b/configure.ac @@ -478,6 +478,14 @@ AC_CONFIG_FILES([ data/control/migration.sh ]) +# Backup scripts +AC_CONFIG_FILES([ +data/scripts/backup.sh +data/scripts/restore.sh +data/scripts/backup_flash.sh +data/scripts/restore_flash.sh +]) + # Backup configs AC_CONFIG_FILES([ data/config/settingsupdate.conf diff --git a/data/config/settingsupdate.conf.in b/data/config/settingsupdate.conf.in index a6ed452a0..dc12fe71a 100644 --- a/data/config/settingsupdate.conf.in +++ b/data/config/settingsupdate.conf.in @@ -51,9 +51,13 @@ @CONFIGDIR@/srv.conf @CONFIGDIR@/flex/flex_eigene_scripte.conf +@FLAGDIR@/ + /var/bin/ -/var/etc/ /var/keys/ +/var/log/ +/var/root/ +/var/xupnpd/ /etc/exports /etc/hostname @@ -62,6 +66,7 @@ /etc/passwd /etc/profile.local /etc/resolv.conf +/etc/samba/smb.conf /etc/wpa_supplicant.conf ## Persönliche Sicherungen diff --git a/data/scripts/Makefile.am b/data/scripts/Makefile.am index bd37213c8..9c5fc797f 100644 --- a/data/scripts/Makefile.am +++ b/data/scripts/Makefile.am @@ -1,3 +1,9 @@ +EXTRA_DIST = \ + backup.sh backup.sh.in \ + restore.sh restore.sh.in \ + backup_flash.sh backup_flash.sh.in \ + restore_flash.sh restore_flash.sh.in + installdir = $(bindir) install_SCRIPTS = \ diff --git a/data/scripts/backup.sh b/data/scripts/backup.sh deleted file mode 100644 index 95c7330ae..000000000 --- a/data/scripts/backup.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/sh - -. /etc/init.d/globals - -HOST=$(hostname) -DATE=$(date +%Y%m%d_%H%M) -USRF="/var/tuxbox/config/tobackup.conf" -BAKF="$1/${2:-settings_${HOST}_${DATE}}.tar.gz" - -TOBACKUP="\ - /etc/exports \ - /etc/hostname \ - /etc/network/interfaces \ - /etc/passwd \ - /etc/profile.local \ - /etc/resolv.conf \ - /etc/samba/smb.conf \ - /etc/wpa_supplicant.conf \ - /share/tuxbox/neutrino/flex/flex_user.conf \ - /var/bin/ \ - /var/etc/ \ - /var/keys/ \ - /var/log/ \ - /var/root/ \ - /var/tuxbox/config/auto-record-cleaner.* \ - /var/tuxbox/config/doscam.* \ - /var/tuxbox/config/FritzCallMonitor.addr \ - /var/tuxbox/config/FritzCallMonitor.cfg \ - /var/tuxbox/config/moviebrowser.conf \ - /var/tuxbox/config/neutrino.conf \ - /var/tuxbox/config/oscam.* \ - /var/tuxbox/config/oscammon.conf \ - /var/tuxbox/config/pr-auto-timer.* \ - /var/tuxbox/config/radio-favorites.xml \ - /var/tuxbox/config/scan.conf \ - /var/tuxbox/config/settingsupdate.conf \ - /var/tuxbox/config/smarthomeinfo.conf \ - /var/tuxbox/config/timerd.conf \ - /var/tuxbox/config/tuxcal/ \ - /var/tuxbox/config/tuxcom/ \ - /var/tuxbox/config/tuxmail/ \ - /var/tuxbox/config/tuxtxt/tuxtxt2.conf \ - /var/tuxbox/config/tuxwetter/tuxwetter.conf \ - /var/tuxbox/config/tuxwetter/tuxwetter.mcfg \ - /var/tuxbox/config/Y-Web.conf \ - /var/tuxbox/config/zapit/ \ - /var/tuxbox/control/ \ - /var/tuxbox/fonts/ \ - /var/tuxbox/httpd/ \ - /var/tuxbox/icons/ \ - /var/tuxbox/locale/ \ - /var/tuxbox/plugins/ \ - /var/tuxbox/themes/ \ - /var/tuxbox/webradio/ \ - /var/tuxbox/webtv/ \ - /var/xupnpd/ \ -" - -SHOWINFO "backup to ${BAKF} ..." - -if [ -e "${USRF}" ]; then - TOBACKUP="$TOBACKUP ${USRF}" - while read i - do [ "${i:0:1}" = "#" ] || TOBACKUP="$TOBACKUP ${i%%#*}" - done < $USRF -fi - -# check existence -RES="" -for i in $TOBACKUP - do [ -e "$i" ] && RES="$RES $i" - done - -TOBACKUP=$(echo $RES) - -tar -czf "${BAKF}" $TOBACKUP 2>&1 >/dev/null - -SHOWINFO "done." diff --git a/data/scripts/backup.sh.in b/data/scripts/backup.sh.in new file mode 100644 index 000000000..948cd6a1d --- /dev/null +++ b/data/scripts/backup.sh.in @@ -0,0 +1,87 @@ +#!/bin/sh + +. /etc/init.d/globals + +HOST=$(hostname) +DATE=$(date +%Y%m%d_%H%M) +USRF="@CONFIGDIR@/tobackup.conf" +BAKF="$1/${2:-settings_${HOST}_${DATE}}.tar.gz" + +TOBACKUP="\ + @CONFIGDIR@/settingsupdate.conf \ + \ + @CONFIGDIR@/auto-record-cleaner.* \ + @CONFIGDIR@/doscam.* \ + @CONFIGDIR@/FritzCallMonitor.addr \ + @CONFIGDIR@/FritzCallMonitor.cfg \ + @CONFIGDIR@/moviebrowser.conf \ + @CONFIGDIR@/neutrino.conf \ + @CONFIGDIR@/oscam.* \ + @CONFIGDIR@/oscammon.conf \ + @CONFIGDIR@/pr-auto-timer.* \ + @CONFIGDIR@/radio-favorites.xml \ + @CONFIGDIR@/scan.conf \ + @CONFIGDIR@/smarthomeinfo.conf \ + @CONFIGDIR@/timerd.conf \ + @CONFIGDIR@/tuxcal/ \ + @CONFIGDIR@/tuxcom/ \ + @CONFIGDIR@/tuxmail/ \ + @CONFIGDIR@/tuxtxt/tuxtxt2.conf \ + @CONFIGDIR@/tuxwetter/tuxwetter.conf \ + @CONFIGDIR@/tuxwetter/tuxwetter.mcfg \ + @CONFIGDIR@/Y-Web.conf \ + @CONFIGDIR@/zapit/ \ + \ + @FLAGDIR@/ \ + \ + /var/bin/ \ + /var/keys/ \ + /var/log/ \ + /var/root/ \ + /var/xupnpd/ \ + \ + /etc/exports \ + /etc/hostname \ + /etc/hosts \ + /etc/network/interfaces \ + /etc/passwd \ + /etc/profile.local \ + /etc/resolv.conf \ + /etc/samba/smb.conf \ + /etc/wpa_supplicant.conf \ + \ + @DATADIR@/neutrino/flex/flex_user.conf \ + @DATADIR_VAR@/flex/flex_user.conf \ + \ + @CONTROLDIR_VAR@/ \ + @FONTDIR_VAR@/ \ + @ICONSDIR_VAR@/ \ + @LOCALEDIR_VAR@/ \ + @LUAPLUGINDIR_VAR@/ \ + @PLUGINDIR_VAR@/ \ + @PUBLIC_HTTPDDIR@/ \ + @THEMESDIR_VAR@/ \ + @WEBRADIODIR_VAR@/ \ + @WEBTVDIR_VAR@/ \ +" + +SHOWINFO "backup to ${BAKF} ..." + +if [ -e "${USRF}" ]; then + TOBACKUP="$TOBACKUP ${USRF}" + while read i + do [ "${i:0:1}" = "#" ] || TOBACKUP="$TOBACKUP ${i%%#*}" + done < $USRF +fi + +# check existence +RES="" +for i in $TOBACKUP + do [ -e "$i" ] && RES="$RES $i" + done + +TOBACKUP=$(echo $RES) + +tar -czf "${BAKF}" $TOBACKUP 2>&1 >/dev/null + +SHOWINFO "done." diff --git a/data/scripts/backup_flash.sh b/data/scripts/backup_flash.sh.in similarity index 93% rename from data/scripts/backup_flash.sh rename to data/scripts/backup_flash.sh.in index 357265fd7..de2dec156 100644 --- a/data/scripts/backup_flash.sh +++ b/data/scripts/backup_flash.sh.in @@ -4,7 +4,7 @@ RES="" VAR="/var/" -USRF="/var/tuxbox/config/tobackup.conf" +USRF="@CONFIGDIR@/tobackup.conf" BAKF="/var/backup_flash.tar.gz" TOBACKUP="" diff --git a/data/scripts/restore.sh b/data/scripts/restore.sh.in similarity index 100% rename from data/scripts/restore.sh rename to data/scripts/restore.sh.in diff --git a/data/scripts/restore_flash.sh b/data/scripts/restore_flash.sh.in similarity index 100% rename from data/scripts/restore_flash.sh rename to data/scripts/restore_flash.sh.in