37 lines
578 B
Bash
Executable File
37 lines
578 B
Bash
Executable File
#!/bin/bash
|
|
|
|
confDir=/etc/backbit
|
|
|
|
if [ ! -z $1 -a -d $1 ]
|
|
then
|
|
confDir=$1
|
|
fi
|
|
|
|
logDir=/var/log/backbit
|
|
|
|
if [ ! -d $logDir ]
|
|
then
|
|
mkdir -p $logDir
|
|
chmod 755 $logDir
|
|
fi
|
|
|
|
if [ -x $confDir/before.sh ]
|
|
then
|
|
. $confDir/before.sh | tee -a $logDir/before.log
|
|
fi
|
|
|
|
for conf in $(ls $confDir/db/*)
|
|
do
|
|
$(which backbitdb) $conf | tee -a $logDir/$(basename $conf).log
|
|
done
|
|
|
|
for conf in $(ls $confDir/dir/*)
|
|
do
|
|
$(which backbitdir) $conf | tee -a $logDir/$(basename $conf).log
|
|
done
|
|
|
|
if [ -x $confDir/after.sh ]
|
|
then
|
|
. $confDir/after.sh | tee -a $logDir/after.log
|
|
fi
|