find ${tmp}/bacula-restores | wc -l | tee $tmp/bacula-restore-list
rm -rf ${tmp}/bacula-restores
-cp working/log files/log${WHICHDB}-$(date +%F_%H-%M).log
+# check the time needed to compute restore list
+if [ x$db_password != x ]; then
+ p="-P $db_password"
+fi
+(time $src/src/tools/bbatch -r 1 -n $db_name -u $db_user $p -w $tmp) >> $working/log 2>&1
+
+cp $working/log files/log${WHICHDB}-$(date +%F_%H-%M).log
cp $tmp/log2.out files/log2${WHICHDB}-$(date +%F_%H-%M).log
+
end_test