improved logging system
This commit is contained in:
parent
51ce34c363
commit
56794c50cd
2 changed files with 6 additions and 6 deletions
10
src/backbit
10
src/backbit
|
@ -12,25 +12,25 @@ logDir=/var/log/backbit
|
||||||
if [ ! -d $logDir ]
|
if [ ! -d $logDir ]
|
||||||
then
|
then
|
||||||
mkdir -p $logDir
|
mkdir -p $logDir
|
||||||
chmod 700 $logDir
|
chmod 755 $logDir
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -x $confDir/before.sh ]
|
if [ -x $confDir/before.sh ]
|
||||||
then
|
then
|
||||||
. $confDir/before.sh
|
. $confDir/before.sh | tee -a $logDir/before.log
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for conf in $(ls $confDir/db/*)
|
for conf in $(ls $confDir/db/*)
|
||||||
do
|
do
|
||||||
( source $conf; $(which backbitdb) $conf >> $logDir/$dbName.log )
|
$(which backbitdb) $conf | tee -a $logDir/$(basename $conf).log
|
||||||
done
|
done
|
||||||
|
|
||||||
for conf in $(ls $confDir/dir/*)
|
for conf in $(ls $confDir/dir/*)
|
||||||
do
|
do
|
||||||
( source $conf; $(which backbitdir) $conf >> $logDir/$name.log )
|
$(which backbitdir) $conf | tee -a $logDir/$(basename $conf).log
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -x $confDir/after.sh ]
|
if [ -x $confDir/after.sh ]
|
||||||
then
|
then
|
||||||
. $confDir/after.sh
|
. $confDir/after.sh | tee -a $logDir/after.log
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -3,4 +3,4 @@ Description=Backup databases and folders
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStart=/usr/bin/backbit
|
ExecStart=/usr/bin/backbit | tee -a /var/log/backbit/main.log
|
||||||
|
|
Loading…
Reference in a new issue