mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-26 15:02:50 +02:00
Origin commit data
------------------
Branch: ni/coolstream
Commit: c3abfa581f
Author: vanhofen <vanhofen@gmx.de>
Date: 2023-10-05 (Thu, 05 Oct 2023)
Origin message was:
------------------
- data/scripts/backup: don't backup /var/log if it is not a directory
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
37 lines
624 B
Bash
37 lines
624 B
Bash
#!/bin/sh
|
|
|
|
. /etc/init.d/globals
|
|
|
|
RES=""
|
|
VAR="/var/"
|
|
USRF="@CONFIGDIR@/tobackup.conf"
|
|
BAKF="/var/backup_flash.tar.gz"
|
|
|
|
TOBACKUP=""
|
|
|
|
# add tobackup.conf and its content
|
|
if [ -e "${USRF}" ]; then
|
|
TOBACKUP="$TOBACKUP ${USRF}"
|
|
while read i
|
|
do [ "${i:0:1}" = "#" ] || TOBACKUP="$TOBACKUP ${i%%#*}"
|
|
done < $USRF
|
|
fi
|
|
|
|
SHOWINFO "backup to ${BAKF} ..."
|
|
|
|
# check existence and skip files in /var
|
|
for i in $TOBACKUP; do
|
|
if [ -e "$i" -a ${i:0:${#VAR}} != ${VAR} ]; then
|
|
SHOWINFO "add $i"
|
|
RES="$RES $i"
|
|
else
|
|
SHOWINFO "skip $i"
|
|
fi
|
|
done
|
|
|
|
TOBACKUP=$(echo $RES)
|
|
|
|
tar -czf "${BAKF}" $TOBACKUP 2>&1 >/dev/null
|
|
|
|
SHOWINFO "done."
|