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
RevLine 
[2422]1#!/bin/bash
2#
[2423]3# Cron to keep track of the consumption and data volume
4# for GENCMIP6 project.
5# To be executed every day at 6am
[2422]6# ======================================================================
7
[2423]8# Initialize module command
9# =========================
[2422]10if [ -f /etc/bashrc ] ; then
[2429]11  . /etc/bashrc
[2422]12fi
[2460]13
[2423]14# Load python
15# ===========
[2845]16# python/2.7.3 is the default, but it comes with matplotlib 1.2,
[2423]17# which is too old (no context manager for PdfPages)
[2422]18module load python/2.7.8
19
[2423]20# Go to root directory
21# ====================
[2460]22ROOT_DIR=$( dirname $0 )
23cd ${ROOT_DIR}
[2422]24
[2423]25# Main script to get data
26# =======================
[2427]27script="conso_gencmip6"
28printf "${script}\n"
29echo "--------------------"
[2437]30bin/${script}.py -v
[2427]31rc=$?
32if [ ${rc} -ne 0 ] ; then
33  echo "${script} terminated abnormally"
34  exit
35else
36  echo "${script} OK"
37fi
[2422]38
[2423]39# Plot daily consumption
40# ======================
41# -f : plot the whole period of the project
42# -d : copy plot on dods
[2460]43# -v : verbose mode
[2427]44script="plot_bilan"
45printf "\n${script}\n"
46echo "--------------------"
[2437]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 "--------------------"
[2460]58bin/${script}.py -fv
[2427]59rc=$?
60if [ ${rc} -ne 0 ] ; then
61  echo "${script} terminated abnormally"
62else
63  echo "${script} OK"
64fi
65
[2849]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
[2427]77script="plot_login"
78printf "\n${script}\n"
79echo "--------------------"
[2437]80bin/${script}.py -v
[2427]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 "--------------------"
[2845]91# Last STORE file produced
[2524]92data_file="OUT_CONSO_STORE"
93OUTDIR="${HOME}/ConsoGENCMIP6/output"
[2845]94# Directories in last file
[2524]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
[2437]107bin/${script}.py -v
[2427]108rc=$?
109if [ ${rc} -ne 0 ] ; then
110  echo "${script} terminated abnormally"
111else
112  echo "${script} OK"
113fi
114
[2845]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
[2849]122
[2427]123printf "\nEnd of script OK\n"
[2433]124
Note: See TracBrowser for help on using the repository browser.