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 ] 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

View File

@ -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