source: trunk/biblehal/biblehal-pushall @ 321

Last change on this file since 321 was 8, checked in by g7moreau, 13 years ago
  • Move biblehal folder in subfolder of trakata
  • Property svn:executable set to *
File size: 1.1 KB
Line 
1#!/bin/bash
2#
3# gabriel 2010/06/03
4
5export PATH="/bin:/usr/bin:/usr/lib/biblehal"
6
7
8num_before=$(biblehal-count)
9
10mkdir -p /var/cache/biblehal/upload
11
12for bibfqname in /var/cache/biblehal/explode/hal-*.bib
13do
14   bibfile=$(basename $bibfqname)
15   if [ -e /var/cache/biblehal/upload/$bibfile ]
16   then
17      if cmp $bibfqname /var/cache/biblehal/upload/$bibfile
18      then
19         echo "Already have $bibfqname"
20         continue
21      fi
22      echo "Delete ref $bibfile on server refbase"
23      biblehal-clean $bibfile
24      num_before=$(( $num_before - 1 ))
25   fi
26
27   echo "Cache file $bibfqname"
28   cp $bibfqname /var/cache/biblehal/upload/
29   
30   echo "Push file $bibfqname - Counter at $num_before"
31   biblehal-push $bibfqname
32   num_after=$(biblehal-count)
33   if [[ $(( $num_after - $num_before )) == 1 ]]
34   then
35      num_before=$num_after
36   else
37      echo "Error on file $bibfqname (number of ref before $num_before / after $num_after)"
38      echo "Cleaning bib $bibfile on server refbase"
39      biblehal-clean $bibfile
40      num_before=$(biblehal-count)
41      continue
42   fi
43done
Note: See TracBrowser for help on using the repository browser.