Added bash script?

Compiling NMM/ARW code for EMS system, upgrading WRF cores on your own, changing EMS scripts to suit your particular needs, and other modifications to original EMS distribution goes in this forum. These are officially unsupported actions.
Post Reply
andres
Posts: 19
Joined: Wed Apr 25, 2018 12:34 pm
Location: Chile

Added bash script?

Post by andres »

Hi all,

I have a postprocessing bash script I would like to execute once the UEMS run finishes. How can I add it to the autorun script?
---
Geophysics Department
University of Concepcion, Chile
lcana
Posts: 79
Joined: Wed Nov 30, 2011 4:34 pm

Re: Added bash script?

Post by lcana »

Hi Andrés,

don´t include your script in autorun. Use cron instead.

Luis
andres
Posts: 19
Joined: Wed Apr 25, 2018 12:34 pm
Location: Chile

Re: Added bash script?

Post by andres »

Hi Luis,

I am doing that now. But the finishing time of the forecast changes a bit. How can I run the next script right after the autorun?
---
Geophysics Department
University of Concepcion, Chile
lcana
Posts: 79
Joined: Wed Nov 30, 2011 4:34 pm

Re: Added bash script?

Post by lcana »

Just take the longest run and then start cron a few minutes later

Luis
meteoadriatic
Posts: 1604
Joined: Wed Aug 19, 2009 10:05 am

Re: Added bash script?

Post by meteoadriatic »

How does your cron entry look like?
andres
Posts: 19
Joined: Wed Apr 25, 2018 12:34 pm
Location: Chile

Re: Added bash script?

Post by andres »

The quasi-standard

30 02 * * * /home/wrf/uems/strc/Ubin/uems_autorun-wrapper.csh --rundir /home/wrf/uems/runs/Coronel > /home/wrf/uems/logs/ems_autorun.log 2>&1 &
---
Geophysics Department
University of Concepcion, Chile
meteoadriatic
Posts: 1604
Joined: Wed Aug 19, 2009 10:05 am

Re: Added bash script?

Post by meteoadriatic »

Try

Code: Select all

30 02 * * * /home/wrf/uems/strc/Ubin/uems_autorun-wrapper.csh --rundir /home/wrf/uems/runs/Coronel > /home/wrf/uems/logs/ems_autorun.log && /path/to/your/additional/srcipt.sh 2>&1 &
Or if that doesn't work for some reason (didn't tested) then edit /home/wrf/uems/strc/Ubin/uems_autorun-wrapper.csh and call your script from the end of that one but this might be overwritten with UEMS update (again not sure).
jorgemauricio
Posts: 9
Joined: Tue Sep 25, 2018 6:32 pm

Re: Added bash script?

Post by jorgemauricio »

First run your auto script at least 3 or 5 times to know the longest run, then

Code: Select all

30 02 * * * /home/user/Documents/auto_script.sh > /home/user/Documents/cron.log 2>&1
remember when using crontab you should use absolut paths
Post Reply