# Dumpster fire of crontab entries that I have running all over the place.
BASH_ENV=/home/mesonet/.bashrc
SHELL=/bin/bash
S=/opt/iem/scripts

# Datateam additions
0 6 * * * bah /opt/datateam/scripts/RUN_6AM.sh

#
0 18,19 * * * cd $S; bah RUN_0Z.sh
1 18,19 * * * cd $S; bah RUN_0Z_ERA5LAND.sh
0 0 * * * cd $S; bah RUN_MIDNIGHT.sh
30 4 * * * cd $S; bah RUN_CLIMODAT_STATE.sh
0 12 * * * cd $S; bah RUN_NOON.sh
# Run at 1:51 to avoid issue with 2AM on DST switch
51 1 * * * cd $S; bah RUN_2AM.sh
10 6,7 * * * cd $S; bah RUN_12Z.sh

10 * * * * cd $S; bah RUN_10_AFTER.sh
20 * * * * cd $S; bah RUN_20_AFTER.sh
40 * * * * cd $S; bah RUN_40_AFTER.sh
50 * * * * cd $S; bah RUN_50_AFTER.sh
59 * * * * cd $S; bah RUN_59_AFTER.sh
59 * * * * cd $S; bah RUN_STAGE4.sh

1 1,7 * * * cd $S; bah RUN_SUMMARY.sh
10 6,7,8,9,10 * * * cd $S; bah RUN_COOP.sh

*/20 * * * * cd $S; bah RUN_20MIN.sh
1,11,21,31,41,51 * * * * cd $S; bah RUN_10MIN.sh
*/5 * * * * cd $S; bah RUN_5MIN.sh
* * * * * cd $S; bah RUN_1MIN.sh

# Drought Monitor
30 8 * * 4 cd /opt/iem/scripts/usdm; python process_usdm.py

# Email Harry RR3 data
14 14 * * 5 cd $S/coop; python email_rr3_to_harry.py

# Process last month's asos 1 min
4 4 9 * * cd $S/ingestors/asos_1minute; python parse_ncei_asos1minute.py --year=$(date --date '11 days ago' +'\%Y') --month=$(date --date '11 days ago' +'\%m')
# Process RT asos 1 min
6 15 * * * cd $S/ingestors/asos_1minute; python parse_ncei_asos1minute.py --date=$(date +'\%Y-\%m-\%d')

03,13,24 * * * * cd $S/plots; bash HOURLY_PLOTS.sh

# webalizer
0 0 * * * cd $S/webalizer; bah processlogs.sh

# Run 36h runs dont finish until 50 after
55 * * * * cd $S; bah RUN_40_AFTER_2.sh

*/2 * * * * cd $S/mrms; sleep 40; timeout 60 python mesh_contours.py --minutes=2 --datetime $(date -u --date '2 minutes ago' +'\%Y-\%m-\%dT\%H:\%M'):00
*/2 * * * * cd $S/mrms; timeout 240 python mesh_contours.py -minutes=30 --valid=$(date -u --date '2 minutes ago' +'\%Y-\%m-\%dT\%H:\%M'):00
0 * * * * cd $S/mrms; sleep 10; python mesh_contours.py --minutes=60 --valid=$(date -u --date '2 minutes ago' +'\%Y-\%m-\%dT\%H:\%M'):00
0 * * * * cd $S/mrms; sleep 15; python mesh_contours.py --minutes=1440 --valid=$(date -u --date '2 minutes ago' +'\%Y-\%m-\%dT\%H:\%M'):00

# Archive ISUSM data
26 6 * * * cd $S/isusm; python archiver.py
