From 56794c50cdd6306ef1f5da8df280b89d21759b55 Mon Sep 17 00:00:00 2001 From: Carlos Galindo Date: Mon, 7 Oct 2019 13:44:30 +0200 Subject: [PATCH] improved logging system --- src/backbit | 10 +++++----- systemd/backbit.service | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/backbit b/src/backbit index a9c6184..f39f7a4 100755 --- a/src/backbit +++ b/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 diff --git a/systemd/backbit.service b/systemd/backbit.service index 0a8dab9..cdf274e 100644 --- a/systemd/backbit.service +++ b/systemd/backbit.service @@ -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