source: trunk/adm/guides/get_pre.sh @ 90

Last change on this file since 90 was 81, checked in by pinsard, 16 years ago

Add guides sources (XML files) and associated makefile

  • Property svn:executable set to *
File size: 2.1 KB
Line 
1#! /bin/sh
2#
3# module :
4# ++ working on get.xml before processing for HTML and wiki
5#
6# update :
7# $Id$
8#
9# /usr/home/fplod/src/superbib_ws/adm/guides/get_pre.sh sur aedon.locean-ipsl.upmc.fr
10#
11# ++ bidon pour l'instat car pas de dépot svn ni de tar file ni de SRC ni de DATA
12#
13# fplod 2008-10-08T10:42:14Z aedon.locean-ipsl.upmc.fr (Darwin)
14# creation
15#
16set -u
17set -o posix
18bidon=1
19if [ ${bidon} -eq 0 ]
20then
21#
22case $( whoami ) in
23    *)
24        lgforge=superbib
25    ;;
26esac
27#
28project="SUPERBIB"
29
30# size of SRC and DATA with .svn
31szallsvn=$( du -sh ../../.. | awk '{print $1}' )
32szallsvn=${szallsvn%*M}
33# size of SRC with .svn
34szsrcsvn=$( du -sh ../../../SRC | awk '{print $1}' )
35szsrcsvn=${szsrcsvn%*M}
36# size of DATA with .svn
37szdatasvn=$( du -sh ../../../DATA | awk '{print $1}' )
38szdatasvn=${szdatasvn%*M}
39#
40echo "iii : you will be asked ${lgforge}@forge.ipsl.jussieu.fr passwd two times"
41#
42# find the most recent ${project}_SRC_yyyymmddrxxx.tar.gz in
43# /ipsl/forge/projets/saxo/download/
44infosrc=$(ssh ${lgforge}@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/superbib/download/${project}_SRC_*.tar.gz  | head -n 1)
45filesrc=$(echo ${infosrc} | awk '{print $NF}')
46szsrc=$(echo ${infosrc} | awk '{print $5}')
47#
48# ndate is the date in the file ${project}_SRC_*.tar.gz
49ndate=${filesrc##*_}
50ndate=${ndate%.tar.gz}
51#
52# find the most recent ${project}_DATA_yyyymmddrxxx.tar.gz in
53# /ipsl/forge/projets/superbib/download/
54infodata=$(ssh ${lgforge}@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/superbib/download/${project}_DATA_*.tar.gz | head -n 1)
55filedata=$(echo ${infodata} | awk '{print $NF}')
56szdata=$(echo ${infodata} | awk '{print $5}')
57#
58# ndate2 is the date in the file ${project}_DATA_*.tar.gz
59ndate2=${filedata##*_}
60ndate2=${ndate2%.tar.gz}
61#
62else
63ndate="YYYYMMDD"
64ndate2="YYYYMMDD"
65szsrc="X"
66szdata="X"
67szallsvn="X"
68szsrcsvn="X"
69szdatasvn="X"
70fi
71#
72sed -e s/"\&date\;"/${ndate}/g \
73    -e s/"\&date2\;"/${ndate2}/g \
74    -e s/"\&szsrc\;"/${szsrc}/g \
75    -e s/"\&szdata\;"/${szdata}/g \
76    -e s/"\&szallsvn\;"/${szallsvn}/g \
77    -e s/"\&szsrcsvn\;"/${szsrcsvn}/g \
78    -e s/"\&szdatasvn\;"/${szdatasvn}/g \
79    get.xml > get_sed.xml
80#
81# exit
82exit 0
Note: See TracBrowser for help on using the repository browser.