source: TOOLS/ConsoGENCMIP6/launch_conso.sh @ 3734

Last change on this file since 3734 was 2849, checked in by labetoulle, 8 years ago

[gencmip6] running/pending jobs:

  • Gather data for whole Curie in addition to that from gencmip6 project
  • Plot hourly data and daily mean
  • Property svn:executable set to *
File size: 2.7 KB
Line 
1#!/bin/bash
2#
3# Cron to keep track of the consumption and data volume
4# for GENCMIP6 project.
5# To be executed every day at 6am
6# ======================================================================
7
8# Initialize module command
9# =========================
10if [ -f /etc/bashrc ] ; then
11  . /etc/bashrc
12fi
13
14# Load python
15# ===========
16# python/2.7.3 is the default, but it comes with matplotlib 1.2,
17# which is too old (no context manager for PdfPages)
18module load python/2.7.8
19
20# Go to root directory
21# ====================
22ROOT_DIR=$( dirname $0 )
23cd ${ROOT_DIR}
24
25# Main script to get data
26# =======================
27script="conso_gencmip6"
28printf "${script}\n"
29echo "--------------------"
30bin/${script}.py -v
31rc=$?
32if [ ${rc} -ne 0 ] ; then
33  echo "${script} terminated abnormally"
34  exit
35else
36  echo "${script} OK"
37fi
38
39# Plot daily consumption
40# ======================
41# -f : plot the whole period of the project
42# -d : copy plot on dods
43# -v : verbose mode
44script="plot_bilan"
45printf "\n${script}\n"
46echo "--------------------"
47bin/${script}.py -fv
48rc=$?
49if [ ${rc} -ne 0 ] ; then
50  echo "${script} terminated abnormally"
51else
52  echo "${script} OK"
53fi
54
55script="plot_bilan_jobs"
56printf "\n${script}\n"
57echo "--------------------"
58bin/${script}.py -fv
59rc=$?
60if [ ${rc} -ne 0 ] ; then
61  echo "${script} terminated abnormally"
62else
63  echo "${script} OK"
64fi
65
66script="plot_jobs_daily"
67printf "\n${script}\n"
68echo "--------------------"
69bin/${script}.py -fv
70rc=$?
71if [ ${rc} -ne 0 ] ; then
72  echo "${script} terminated abnormally"
73else
74  echo "${script} OK"
75fi
76
77script="plot_login"
78printf "\n${script}\n"
79echo "--------------------"
80bin/${script}.py -v
81rc=$?
82if [ ${rc} -ne 0 ] ; then
83  echo "${script} terminated abnormally"
84else
85  echo "${script} OK"
86fi
87
88script="plot_store"
89printf "\n${script}\n"
90echo "--------------------"
91# Last STORE file produced
92data_file="OUT_CONSO_STORE"
93OUTDIR="${HOME}/ConsoGENCMIP6/output"
94# Directories in last file
95dirlist=$( gawk '{if ($4 != "dirname") print $4}' ${OUTDIR}/${data_file} )
96# Where to find the saved files
97SAVEDIR="${WORKDIR}/ConsoGENCMIP6/data"
98# Previous STORE files
99filelist=$( ls ${SAVEDIR}/${data_file}_* )
100fileout="${data_file}_INIT"
101echo "date       login      dirsize dirname" > ${OUTDIR}/${fileout}
102for dir in ${dirlist} ; do
103  grep -h "$dir\$" ${filelist} | head -1
104  grep -h "$dir\$" ${filelist} | head -1 >> ${OUTDIR}/${fileout}
105done
106
107bin/${script}.py -v
108rc=$?
109if [ ${rc} -ne 0 ] ; then
110  echo "${script} terminated abnormally"
111else
112  echo "${script} OK"
113fi
114
115
116# Copy web files to ciclad
117# ========================
118echo "=> Copy web files to ciclad"
119echo "==========================="
120rsync -var ${ROOT_DIR}/web/* igcmg@ciclad.ipsl.jussieu.fr:dods/ConsoGENCMIP6
121
122
123printf "\nEnd of script OK\n"
124
Note: See TracBrowser for help on using the repository browser.