Imported Upstream version 2.4.5
[debian/amanda] / server-src / amdump.sh.in
index ce56b8f164c3c7f8ceac0d2d9544a005f569af8c..28ba2a5ed95ea1c5a73d65bc793ecda9aebf498a 100644 (file)
@@ -93,19 +93,26 @@ fi
 umask 077
 
 # Plan and drive the dumps.
-exec </dev/null >$errfile 2>&1
+#exec </dev/null >$errfile 2>&1
+touch $errfile
+exec </dev/null 2>>$errfile 1>&2
 echo "amdump: start at `date`"
 echo "amdump: datestamp `date +%Y%m%d`"
 $libexecdir/planner$SUF "$@" | $libexecdir/driver$SUF $conf
 echo "amdump: end at `date`"
 
 # Send out a report on the dumps.
-exec </dev/null >/dev/null 2>&1
 $sbindir/amreport$SUF $conf
 
 # Roll the log file to its datestamped name.
 $libexecdir/amlogroll$SUF $conf
 
+# Trim the log file to those for dumps that still exist.
+$libexecdir/amtrmlog$SUF $conf
+
+# Trim the index file to those for dumps that still exist.
+$libexecdir/amtrmidx$SUF $conf
+
 # Keep a debug log through the tapecycle plus a couple of days.
 maxdays=`expr $tapecycle + 2`
 days=1
@@ -122,10 +129,4 @@ while [ $days -ge 2 ]; do
 done
 mv $errfile $errfile.1
 
-# Trim the log file to those for dumps that still exist.
-$libexecdir/amtrmlog$SUF $conf
-
-# Trim the index file to those for dumps that still exist.
-$libexecdir/amtrmidx$SUF $conf
-
 exit 0