#!/bin/bash # # Cron to keep track of the consumption and data volume # for GENCMIP6 project. # To be executed every day at 6am # ====================================================================== # Initialize module command # ========================= if [ -f /etc/bashrc ] ; then . /etc/bashrc fi # Load python # =========== # python/2.7.3 is the default, but it comes with matplotlib 1.2, # which is too old (no context manager for PdfPages) module load python/2.7.8 # Go to root directory # ==================== cd /ccc/cont003/home/dsm/p86ipsl/ConsoGENCMIP6/ # Main script to get data # ======================= script="conso_gencmip6" printf "${script}\n" echo "--------------------" bin/${script}.py rc=$? if [ ${rc} -ne 0 ] ; then echo "${script} terminated abnormally" exit else echo "${script} OK" fi # Plot daily consumption # ====================== # -f : plot the whole period of the project # -d : copy plot on dods script="plot_bilan" printf "\n${script}\n" echo "--------------------" bin/${script}.py -fd rc=$? if [ ${rc} -ne 0 ] ; then echo "${script} terminated abnormally" else echo "${script} OK" fi script="plot_login" printf "\n${script}\n" echo "--------------------" bin/${script}.py -d rc=$? if [ ${rc} -ne 0 ] ; then echo "${script} terminated abnormally" else echo "${script} OK" fi script="plot_store" printf "\n${script}\n" echo "--------------------" bin/${script}.py -d rc=$? if [ ${rc} -ne 0 ] ; then echo "${script} terminated abnormally" else echo "${script} OK" fi printf "\nEnd of script OK\n"