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 ]
|
||||
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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue