#!/bin/bash
source ~/.bash_profile

today=$(date "+%Y%m%d")
YYYYMM=$(date "+%Y-%m")
yesterday=$(date +"%Y%m%d" -d +"-1day")

rm -r /massdata2/weather/projects_lerc/MYJF_Data/$yesterday/1005/

cd /massdata2/weather/projects_lerc/MYJF_Data/$today/

if [[ -d "1005/" && -d "1006/" && -d "1007/" ]];then
    if [[ -d "log/" ]];then
        rm -r log/
    fi
    java -jar /massdata2/weather/projects_lerc/MYJF_Data/file-upload-1.2.1.jar /massdata2/weather/projects_lerc/MYJF_Data/$today/
    
fi
