backup.sh: rename backup.list to tobackup.conf & move to /var/tuxbox/config/t (thx svenhoefer)

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1948 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
satbaby
2011-12-06 13:33:26 +00:00
parent df51fb1583
commit 1922213fc4
5 changed files with 30 additions and 14 deletions

View File

@@ -5,4 +5,4 @@ SUBDIRS += lcd
endif
configdir = $(CONFIGDIR)
config_DATA = cables.xml satellites.xml encoding.conf
config_DATA = cables.xml satellites.xml encoding.conf tobackup.conf

View File

@@ -3,8 +3,7 @@ installdir = $(bindir)
install_DATA = \
backup.sh \
restore.sh \
install.sh \
backup.list
install.sh
install-data-hook:
chmod 0755 $(DESTDIR)$(bindir)/backup.sh

View File

@@ -1,3 +0,0 @@
/bin/backup.sh
/bin/backup.list
/var/tuxbox/config/

View File

@@ -1,12 +1,26 @@
#!/bin/sh
DATE=`date +%Y-%m-%d-%H:%M:%S`
BACKUPLIST=/bin/backup.list
DATE=$(date +%Y-%m-%d_%H-%M-%S)
USRF="/var/tuxbox/config/tobackup.conf"
if [ -e "${USRF}" ]; then
# read user-files from $USRF
while read i
do [ "${i:0:1}" = "#" ] || TOBACKUP="$TOBACKUP ${i%%#*}"
done < $USRF
else
TOBACKUP="/var/tuxbox/config/"
fi
# check existence
RES=""
for i in $TOBACKUP
do [ -e "$i" ] && RES="$RES $i"
done
TOBACKUP=$(echo $RES)
echo Backup to $1/settings_$DATE.tar
cd /
if [ ! -e $BACKUPLIST ]; then
tar cf $1/settings_$DATE.tar /var/tuxbox/config/
else
tar cf $1/settings_$DATE.tar -T $BACKUPLIST
fi
tar -cf $1/settings_$DATE.tar $TOBACKUP

6
data/tobackup.conf Normal file
View File

@@ -0,0 +1,6 @@
# enter stuff you want to backup here.
# one file or directory per line
#
# /var/etc/rcS.local # an example for a single file
# /var/tuxbox/config/tuxtxt/ # an example for a complete directory
/var/tuxbox/config/ # old default