Last change
on this file since 2428 was
2427,
checked in by labetoulle, 9 years ago
|
Move common functions to common module
|
File size:
1.5 KB
|
Rev | Line | |
---|
[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] | 10 | if [ -f /etc/bashrc ] ; then |
---|
[2424] | 11 | ./etc/bashrc |
---|
[2422] | 12 | fi |
---|
[2423] | 13 | # Load python |
---|
| 14 | # =========== |
---|
| 15 | #Â python/2.7.3 is the default, but it comes with matplotlib 1.2, |
---|
| 16 | # which is too old (no context manager for PdfPages) |
---|
[2422] | 17 | module load python/2.7.8 |
---|
| 18 | |
---|
[2423] | 19 | # Go to root directory |
---|
| 20 | # ==================== |
---|
[2422] | 21 | cd /ccc/cont003/home/dsm/p86ipsl/ConsoGENCMIP6/ |
---|
| 22 | |
---|
[2423] | 23 | # Main script to get data |
---|
| 24 | # ======================= |
---|
[2427] | 25 | script="conso_gencmip6" |
---|
| 26 | printf "${script}\n" |
---|
| 27 | echo "--------------------" |
---|
| 28 | bin/${script}.py |
---|
| 29 | rc=$? |
---|
| 30 | if [ ${rc} -ne 0 ] ; then |
---|
| 31 | echo "${script} terminated abnormally" |
---|
| 32 | exit |
---|
| 33 | else |
---|
| 34 | echo "${script} OK" |
---|
| 35 | fi |
---|
[2422] | 36 | |
---|
[2423] | 37 | # Plot daily consumption |
---|
| 38 | # ====================== |
---|
| 39 | # -f : plot the whole period of the project |
---|
| 40 | # -d : copy plot on dods |
---|
[2427] | 41 | script="plot_bilan" |
---|
| 42 | printf "\n${script}\n" |
---|
| 43 | echo "--------------------" |
---|
| 44 | bin/${script}.py -fd |
---|
| 45 | rc=$? |
---|
| 46 | if [ ${rc} -ne 0 ] ; then |
---|
| 47 | echo "${script} terminated abnormally" |
---|
| 48 | else |
---|
| 49 | echo "${script} OK" |
---|
| 50 | fi |
---|
| 51 | |
---|
| 52 | script="plot_login" |
---|
| 53 | printf "\n${script}\n" |
---|
| 54 | echo "--------------------" |
---|
| 55 | bin/${script}.py -d |
---|
| 56 | rc=$? |
---|
| 57 | if [ ${rc} -ne 0 ] ; then |
---|
| 58 | echo "${script} terminated abnormally" |
---|
| 59 | else |
---|
| 60 | echo "${script} OK" |
---|
| 61 | fi |
---|
| 62 | |
---|
| 63 | script="plot_store" |
---|
| 64 | printf "\n${script}\n" |
---|
| 65 | echo "--------------------" |
---|
| 66 | bin/${script}.py -d |
---|
| 67 | rc=$? |
---|
| 68 | if [ ${rc} -ne 0 ] ; then |
---|
| 69 | echo "${script} terminated abnormally" |
---|
| 70 | else |
---|
| 71 | echo "${script} OK" |
---|
| 72 | fi |
---|
| 73 | |
---|
| 74 | printf "\nEnd of script OK\n" |
---|
Note: See
TracBrowser
for help on using the repository browser.