Page 1 of 1

Added bash script?

Posted: Wed May 09, 2018 2:46 pm
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?

Re: Added bash script?

Posted: Wed May 16, 2018 9:57 am
by lcana
Hi Andrés,

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

Luis

Re: Added bash script?

Posted: Thu May 17, 2018 1:29 pm
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?

Re: Added bash script?

Posted: Thu May 17, 2018 2:04 pm
by lcana
Just take the longest run and then start cron a few minutes later

Luis

Re: Added bash script?

Posted: Thu May 17, 2018 5:42 pm
by meteoadriatic
How does your cron entry look like?

Re: Added bash script?

Posted: Thu May 17, 2018 9:55 pm
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 &

Re: Added bash script?

Posted: Fri May 18, 2018 8:27 am
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).

Re: Added bash script?

Posted: Tue Sep 25, 2018 6:42 pm
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