improved logging system

This commit is contained in:
Carlos Galindo 2019-10-07 13:44:30 +02:00
parent 51ce34c363
commit 56794c50cd
Signed by: kauron
GPG Key ID: 83E68706DEE119A3
2 changed files with 6 additions and 6 deletions

View File

@ -12,25 +12,25 @@ logDir=/var/log/backbit
if [ ! -d $logDir ]
then
mkdir -p $logDir
chmod 700 $logDir
chmod 755 $logDir
fi
if [ -x $confDir/before.sh ]
then
. $confDir/before.sh
. $confDir/before.sh | tee -a $logDir/before.log
fi
for conf in $(ls $confDir/db/*)
do
( source $conf; $(which backbitdb) $conf >> $logDir/$dbName.log )
$(which backbitdb) $conf | tee -a $logDir/$(basename $conf).log
done
for conf in $(ls $confDir/dir/*)
do
( source $conf; $(which backbitdir) $conf >> $logDir/$name.log )
$(which backbitdir) $conf | tee -a $logDir/$(basename $conf).log
done
if [ -x $confDir/after.sh ]
then
. $confDir/after.sh
. $confDir/after.sh | tee -a $logDir/after.log
fi

View File

@ -3,4 +3,4 @@ Description=Backup databases and folders
[Service]
Type=oneshot
ExecStart=/usr/bin/backbit
ExecStart=/usr/bin/backbit | tee -a /var/log/backbit/main.log