1 | #!/bin/bash |
---|
2 | # |
---|
3 | # Cron to keep track of core usage for GENCMIP6 project. |
---|
4 | # To be executed every hour |
---|
5 | # ====================================================================== |
---|
6 | |
---|
7 | # Initialize module command |
---|
8 | # ========================= |
---|
9 | if [ -f /etc/bashrc ] ; then |
---|
10 | . /etc/bashrc |
---|
11 | fi |
---|
12 | # Load python |
---|
13 | # =========== |
---|
14 | #Â python/2.7.3 is the default, but it comes with matplotlib 1.2, |
---|
15 | # which is too old (no context manager for PdfPages) |
---|
16 | module load python/2.7.8 |
---|
17 | |
---|
18 | # Go to root directory |
---|
19 | # ==================== |
---|
20 | ROOT_DIR=$( dirname $0 ) |
---|
21 | cd ${ROOT_DIR} |
---|
22 | |
---|
23 | # Main script to get data for gencmip6 |
---|
24 | # ==================================== |
---|
25 | script="run_pen_v2" |
---|
26 | printf "${script}\n" |
---|
27 | echo "--------------------" |
---|
28 | bin/${script}.sh |
---|
29 | rc=$? |
---|
30 | if [ ${rc} -ne 0 ] ; then |
---|
31 | echo "${script} terminated abnormally" |
---|
32 | exit |
---|
33 | else |
---|
34 | echo "${script} OK" |
---|
35 | fi |
---|
36 | |
---|
37 | # Main script to get data for whole Curie |
---|
38 | # ======================================= |
---|
39 | script="run_pen_full" |
---|
40 | printf "${script}\n" |
---|
41 | echo "--------------------" |
---|
42 | bin/${script}.sh |
---|
43 | rc=$? |
---|
44 | if [ ${rc} -ne 0 ] ; then |
---|
45 | echo "${script} terminated abnormally" |
---|
46 | exit |
---|
47 | else |
---|
48 | echo "${script} OK" |
---|
49 | fi |
---|
50 | |
---|
51 | # Plot running and pending jobs |
---|
52 | # ============================= |
---|
53 | # -d : copy plot on dods |
---|
54 | # -m : mode, 'project' (=default) or 'machine' |
---|
55 | script="plot_jobs" |
---|
56 | printf "\n${script}\n" |
---|
57 | echo "--------------------" |
---|
58 | bin/${script}.py -v |
---|
59 | rc=$? |
---|
60 | if [ ${rc} -ne 0 ] ; then |
---|
61 | echo "${script} terminated abnormally" |
---|
62 | else |
---|
63 | echo "${script} OK" |
---|
64 | fi |
---|
65 | |
---|
66 | printf "\n${script}\n" |
---|
67 | echo "--------------------" |
---|
68 | bin/${script}.py -vm machine |
---|
69 | rc=$? |
---|
70 | if [ ${rc} -ne 0 ] ; then |
---|
71 | echo "${script} terminated abnormally" |
---|
72 | else |
---|
73 | echo "${script} OK" |
---|
74 | fi |
---|
75 | |
---|
76 | script="plot_jobs_hourly" |
---|
77 | printf "\n${script}\n" |
---|
78 | echo "--------------------" |
---|
79 | bin/${script}.py -vd |
---|
80 | rc=$? |
---|
81 | if [ ${rc} -ne 0 ] ; then |
---|
82 | echo "${script} terminated abnormally" |
---|
83 | else |
---|
84 | echo "${script} OK" |
---|
85 | fi |
---|
86 | |
---|
87 | |
---|
88 | # Copy web files to ciclad |
---|
89 | # ======================== |
---|
90 | echo "=> Copy web files to ciclad" |
---|
91 | echo "===========================" |
---|
92 | rsync -var ${ROOT_DIR}/web/* igcmg@ciclad.ipsl.jussieu.fr:dods/ConsoGENCMIP6 |
---|
93 | |
---|
94 | |
---|
95 | printf "\nEnd of script OK\n" |
---|
96 | |
---|