mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-26 23:13:13 +02:00
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:
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -1,3 +0,0 @@
|
||||
/bin/backup.sh
|
||||
/bin/backup.list
|
||||
/var/tuxbox/config/
|
@@ -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
6
data/tobackup.conf
Normal 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
|
Reference in New Issue
Block a user