annotate archivemany.sh @ 23:a3c35eae25dc

added count in archivemany removed abort on wrong user in archiver (problem with screen)
author casties
date Fri, 23 Sep 2005 19:16:17 +0200
parents fdf4ceb36db1
children 8b9d91963de7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
1 #!/bin/bash
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
2
23
a3c35eae25dc added count in archivemany
casties
parents: 18
diff changeset
3 VERSION="archivemany V0.2 (23.9.2005 ROC)"
15
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
4
18
fdf4ceb36db1 fixed problem with dir names in metacheck
casties
parents: 15
diff changeset
5 #set -x
fdf4ceb36db1 fixed problem with dir names in metacheck
casties
parents: 15
diff changeset
6
15
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
7 if [ -z "$1$2" ]
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
8 then
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
9 echo $VERSION
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
10 echo "use: $0 docdir dirlist"
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
11 echo " Archives the directories given in the file dirlist inside docdir."
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
12 exit 1
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
13 fi
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
14
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
15 BASEDIR="$1"
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
16 DIRLIST="$2"
18
fdf4ceb36db1 fixed problem with dir names in metacheck
casties
parents: 15
diff changeset
17 PARAM="$3"
23
a3c35eae25dc added count in archivemany
casties
parents: 18
diff changeset
18 CNT="1"
15
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
19
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
20 if [ ! -d $BASEDIR ]
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
21 then
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
22 echo "ERROR: base directory $BASEDIR not found!"
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
23 exit 1
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
24 fi
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
25
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
26 if [ ! -f $DIRLIST ]
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
27 then
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
28 echo "ERROR: directory list file $DIRLIST not found!"
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
29 exit 1
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
30 fi
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
31
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
32 cat $DIRLIST | while read DIR
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
33 do
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
34 if [ -d "$BASEDIR/$DIR" ]
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
35 then
23
a3c35eae25dc added count in archivemany
casties
parents: 18
diff changeset
36 echo "archiving document $CNT: $DIR..."
18
fdf4ceb36db1 fixed problem with dir names in metacheck
casties
parents: 15
diff changeset
37 if /usr/local/mpiwg/archive/archiver "$PARAM" "$BASEDIR/$DIR"
15
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
38 then
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
39 echo " done on `date`"
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
40 else
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
41 echo "FAILED!"
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
42 # abort?
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
43 fi
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
44 else
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
45 echo "ERROR: document directory $BASEDIR/$DIR not found!"
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
46 fi
23
a3c35eae25dc added count in archivemany
casties
parents: 18
diff changeset
47 CNT=$(( $CNT + 1 ))
15
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
48 done