-
Notifications
You must be signed in to change notification settings - Fork 0
/
make_pictures.sh
executable file
·67 lines (53 loc) · 1.62 KB
/
make_pictures.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
set -u -e
# put logo if corresponding command is provided
#cd $scriptdir/delme || exit 234
#Acquire and polt
source environment_$1
picture_dir=$OUTPUT_DIR/webloads/${fcdate}
python3 Plot_SILAM_forecast.py
nproc=`nproc`
if [ -z ${PUTLOGOCMD+x} ]; then
echo PUTLOGOCMD is not set
else
echo Putting logos
ls ${picture_dir}/*.png |grep -v AQI_ |grep -v POLI_| xargs -I XXX -P 10 ${PUTLOGOCMD} XXX XXX
if [ -n ${PUTLOGOCMDINDEX+x} ]; then
#separate logo for AQI
ls ${picture_dir}/*[AO][QL]I_???.png | xargs -I XXX -P 10 ${PUTLOGOCMDINDEX} XXX XXX
fi
echo compressing pics
ls ${picture_dir}/*.png | xargs -I XXX -P $nproc convert XXX PNG8:XXX
fi
#echo waiting..
#wait
echo Done with logos!
[ -n "$outsuff" ] && exit 0 #No publish for modified runs
if $publish; then
keepdays=7
pushd $picture_dir/..
for d in `find . -type d -name '20??????'|sort|head -n -$keepdays`; do
echo removing $d
rm -rf $d
done
ii=0
for d in `find . -type d -name '20??????'|sort -r`; do
linkname=`printf %03d $ii`
rm -f $linkname
echo ln -s $d $linkname
ln -sf $d $linkname
ii=`expr $ii + 1`
done
#deploy animation if not yet...
if [ ! -d Napit ]; then
rsync -av $scriptdir/www/*.html .
sed -i "s/XXXXXXX/${domainname}/g" toc.html
tar -xvf $scriptdir/www/Napit.tar
fi
popd
fmi_data_path=eslogin:/fmi/data/silam.fmi.fi/partners/$suitename
echo Syncing $OUTPUT_DIR/webloads to $fmi_data_path
# mkdir -p $fmi_data_path
rsync -a --delete $OUTPUT_DIR/webloads/* $fmi_data_path/
fi
exit 0