
# ./cams_import.sh 2022-01-29 2022-01-28

export dd=$1
export dd1=$2

cd /opt/cams/import

tar zxvf ~/cams_export_${dd}.tar.gz

mv *EllaRoberta* /opt/cams/EllaRoberta/.
mv *europe* /opt/cams/europe/.
mv *NLBE* /opt/cams/NLBE/.

export region=EllaRoberta

cd /opt/cams/${region} 
rm *_latest.gif
rm *_latest.jpeg

ln -s ${region}_pm25_so2_no2_o3_forecast_${dd}.gif ${region}_pm25_so2_no2_o3_forecast_latest.gif
ln -s ${region}_pm25_so2_no2_o3_forecast_${dd}.jpeg ${region}_pm25_so2_no2_o3_forecast_latest.jpeg
ln -s ${region}_no2_forecast_${dd}.gif ${region}_no2_forecast_latest.gif
ln -s ${region}_no2_forecast_${dd}.jpeg ${region}_no2_forecast_latest.jpeg
ln -s ${region}_so2_forecast_${dd}.gif ${region}_so2_forecast_latest.gif
ln -s ${region}_so2_forecast_${dd}.jpeg ${region}_so2_forecast_latest.jpeg
ln -s ${region}_pm25_forecast_${dd}.gif ${region}_pm25_forecast_latest.gif
ln -s ${region}_pm25_forecast_${dd}.jpeg ${region}_pm25_forecast_latest.jpeg
ln -s ${region}_o3_forecast_${dd}.gif ${region}_o3_forecast_latest.gif
ln -s ${region}_o3_forecast_${dd}.jpeg ${region}_o3_forecast_latest.jpeg

rm *_latest-1.gif
rm *_latest-1.jpeg

ln -s ${region}_pm25_so2_no2_o3_forecast_${dd1}.gif ${region}_pm25_so2_no2_o3_forecast_latest-1.gif
ln -s ${region}_pm25_so2_no2_o3_forecast_${dd1}.jpeg ${region}_pm25_so2_no2_o3_forecast_latest-1.jpeg
ln -s ${region}_no2_forecast_${dd1}.gif ${region}_no2_forecast_latest-1.gif
ln -s ${region}_no2_forecast_${dd1}.jpeg ${region}_no2_forecast_latest-1.jpeg
ln -s ${region}_so2_forecast_${dd1}.gif ${region}_so2_forecast_latest-1.gif
ln -s ${region}_so2_forecast_${dd1}.jpeg ${region}_so2_forecast_latest-1.jpeg
ln -s ${region}_pm25_forecast_${dd1}.gif ${region}_pm25_forecast_latest-1.gif
ln -s ${region}_pm25_forecast_${dd1}.jpeg ${region}_pm25_forecast_latest-1.jpeg
ln -s ${region}_o3_forecast_${dd1}.gif ${region}_o3_forecast_latest-1.gif
ln -s ${region}_o3_forecast_${dd1}.jpeg ${region}_o3_forecast_latest-1.jpeg

export region=europe

cd /opt/cams/${region} 
rm *_latest.gif
rm *_latest.jpeg

ln -s ${region}_pm25_so2_no2_o3_forecast_${dd}.gif ${region}_pm25_so2_no2_o3_forecast_latest.gif
ln -s ${region}_pm25_so2_no2_o3_forecast_${dd}.jpeg ${region}_pm25_so2_no2_o3_forecast_latest.jpeg
ln -s ${region}_small_no2_forecast_${dd}.gif ${region}_no2_forecast_latest.gif
ln -s ${region}_small_no2_forecast_${dd}.jpeg ${region}_no2_forecast_latest.jpeg
ln -s ${region}_small_so2_forecast_${dd}.gif ${region}_so2_forecast_latest.gif
ln -s ${region}_small_so2_forecast_${dd}.jpeg ${region}_so2_forecast_latest.jpeg
ln -s ${region}_small_pm25_forecast_${dd}.gif ${region}_pm25_forecast_latest.gif
ln -s ${region}_small_pm25_forecast_${dd}.jpeg ${region}_pm25_forecast_latest.jpeg
ln -s ${region}_small_o3_forecast_${dd}.gif ${region}_o3_forecast_latest.gif
ln -s ${region}_small_o3_forecast_${dd}.jpeg ${region}_o3_forecast_latest.jpeg

rm *_latest-1.gif
rm *_latest-1.jpeg

ln -s ${region}_pm25_so2_no2_o3_forecast_${dd1}.gif ${region}_pm25_so2_no2_o3_forecast_latest-1.gif
ln -s ${region}_pm25_so2_no2_o3_forecast_${dd1}.jpeg ${region}_pm25_so2_no2_o3_forecast_latest-1.jpeg
ln -s ${region}_small_no2_forecast_${dd1}.gif ${region}_no2_forecast_latest-1.gif
ln -s ${region}_small_no2_forecast_${dd1}.jpeg ${region}_no2_forecast_latest-1.jpeg
ln -s ${region}_small_so2_forecast_${dd1}.gif ${region}_so2_forecast_latest-1.gif
ln -s ${region}_small_so2_forecast_${dd1}.jpeg ${region}_so2_forecast_latest-1.jpeg
ln -s ${region}_small_pm25_forecast_${dd1}.gif ${region}_pm25_forecast_latest-1.gif
ln -s ${region}_small_pm25_forecast_${dd1}.jpeg ${region}_pm25_forecast_latest-1.jpeg
ln -s ${region}_small_o3_forecast_${dd1}.gif ${region}_o3_forecast_latest-1.gif
ln -s ${region}_small_o3_forecast_${dd1}.jpeg ${region}_o3_forecast_latest-1.jpeg

export region=NLBE

cd /opt/cams/${region} 
rm *_latest.gif
rm *_latest.jpeg

ln -s ${region}_pm25_so2_no2_o3_forecast_${dd}.gif ${region}_pm25_so2_no2_o3_forecast_latest.gif
ln -s ${region}_pm25_so2_no2_o3_forecast_${dd}.jpeg ${region}_pm25_so2_no2_o3_forecast_latest.jpeg
ln -s ${region}_no2_forecast_${dd}.gif ${region}_no2_forecast_latest.gif
ln -s ${region}_no2_forecast_${dd}.jpeg ${region}_no2_forecast_latest.jpeg
ln -s ${region}_so2_forecast_${dd}.gif ${region}_so2_forecast_latest.gif
ln -s ${region}_so2_forecast_${dd}.jpeg ${region}_so2_forecast_latest.jpeg
ln -s ${region}_pm25_forecast_${dd}.gif ${region}_pm25_forecast_latest.gif
ln -s ${region}_pm25_forecast_${dd}.jpeg ${region}_pm25_forecast_latest.jpeg
ln -s ${region}_o3_forecast_${dd}.gif ${region}_o3_forecast_latest.gif
ln -s ${region}_o3_forecast_${dd}.jpeg ${region}_o3_forecast_latest.jpeg

rm *_latest-1.gif
rm *_latest-1.jpeg

ln -s ${region}_pm25_so2_no2_o3_forecast_${dd1}.gif ${region}_pm25_so2_no2_o3_forecast_latest-1.gif
ln -s ${region}_pm25_so2_no2_o3_forecast_${dd1}.jpeg ${region}_pm25_so2_no2_o3_forecast_latest-1.jpeg
ln -s ${region}_no2_forecast_${dd1}.gif ${region}_no2_forecast_latest-1.gif
ln -s ${region}_no2_forecast_${dd1}.jpeg ${region}_no2_forecast_latest-1.jpeg
ln -s ${region}_so2_forecast_${dd1}.gif ${region}_so2_forecast_latest-1.gif
ln -s ${region}_so2_forecast_${dd1}.jpeg ${region}_so2_forecast_latest-1.jpeg
ln -s ${region}_pm25_forecast_${dd1}.gif ${region}_pm25_forecast_latest-1.gif
ln -s ${region}_pm25_forecast_${dd1}.jpeg ${region}_pm25_forecast_latest-1.jpeg
ln -s ${region}_o3_forecast_${dd1}.gif ${region}_o3_forecast_latest-1.gif
ln -s ${region}_o3_forecast_${dd1}.jpeg ${region}_o3_forecast_latest-1.jpeg

