]> git.sesse.net Git - backup.sh/commitdiff
Initial revision
authorroot <empty>
Thu, 19 Oct 2000 09:06:03 +0000 (09:06 +0000)
committerroot <empty>
Thu, 19 Oct 2000 09:06:03 +0000 (09:06 +0000)
report.sh [new file with mode: 0755]

diff --git a/report.sh b/report.sh
new file mode 100755 (executable)
index 0000000..40b7979
--- /dev/null
+++ b/report.sh
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+#Hovedkatalogen
+topdir=$1
+#Utfil
+utfil=$2
+
+dato=`date`
+
+cd $topdir
+for maskin in `ls -1d ?* | grep -v lost+found`
+do
+ cd $topdir/$maskin
+ for del in `ls -1d ?* | grep -v .name`
+ do
+  delnavn=`cat $topdir/$maskin/$del.name`
+  cd $topdir/$maskin/$del
+  for level in `ls -1d ?*`
+  do
+   cd $topdir/$maskin/$del/$level
+   #pwd
+   for fil in *.idx
+   do
+    if `tail -1 $fil | grep ^tar: > /dev/null 2>&1`
+    then
+     feilm="feil"
+    else
+     feilm="ok"
+    fi
+
+prefix=`echo $fil | cut -d . -f 1`
+tgzfil=$topdir/$maskin/$del/$level/${prefix}.tgz
+str=`du $tgzfil | awk '{print $1}'`
+aar=`echo $prefix | cut -c 1-4`
+mnd=`echo $prefix | cut -c 5,6`
+dag=`echo $prefix | cut -c 7,8`
+
+#output
+echo ${maskin}:${delnavn}:${level}:${aar}/${mnd}/${dag}:${feilm}:${str}:${tgzfil} >> $utfil.tmp
+
+   done
+  done
+ done
+done
+
+mv $utfil.tmp $utfil
+chmod 644 $utfil