annotate archivemany.sh @ 18:fdf4ceb36db1

fixed problem with dir names in metacheck new version of metacheck defaults to not change index file new version of archiver uses new version of metacheck
author casties
date Tue, 20 Sep 2005 19:24:57 +0200
parents 8d2f0586eca6
children a3c35eae25dc
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
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
3 VERSION="archivemany V0.1 (14.6.2005 ROC)"
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"
15
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
18
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
19 if [ ! -d $BASEDIR ]
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
20 then
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
21 echo "ERROR: base directory $BASEDIR not found!"
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
22 exit 1
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
23 fi
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
24
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
25 if [ ! -f $DIRLIST ]
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
26 then
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
27 echo "ERROR: directory list file $DIRLIST not found!"
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
28 exit 1
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
29 fi
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
30
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
31 cat $DIRLIST | while read DIR
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
32 do
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
33 if [ -d "$BASEDIR/$DIR" ]
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
34 then
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
35 echo "archiving $DIR..."
18
fdf4ceb36db1 fixed problem with dir names in metacheck
casties
parents: 15
diff changeset
36 if /usr/local/mpiwg/archive/archiver "$PARAM" "$BASEDIR/$DIR"
15
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
37 then
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
38 echo " done on `date`"
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
39 else
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
40 echo "FAILED!"
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
41 # abort?
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
42 fi
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
43 else
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
44 echo "ERROR: document directory $BASEDIR/$DIR not found!"
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
45 fi
8d2f0586eca6 new helper script for calling archiver on many directories
casties
parents:
diff changeset
46 done