open browser for forecast

All other topics about postprocessing model data (GrADS and other software), about other numerical weather prediction software (including WRF-NMM and WRF-ARW discussion unrelated to UEMS/WRF EMS), and general meteorology talk go in this forum.
dominic
Posts: 336
Joined: Thu Jun 14, 2012 7:19 am

open browser for forecast

Post by dominic » Mon Feb 03, 2014 8:48 am

Hello everyone, did you ever have the need to launch the browser to generate the scripts?

I would have this need, namely to create a script that opens sh eg firefox or chromium at a certain time and for a number of seconds.

the browser must open a specific page of course

some of you did it?

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

Re: open browser for forecast

Post by meteoadriatic » Mon Feb 03, 2014 9:17 am

Just put into script

firefox http://your.address...

when you need to close it, you can use it's pid, or if you want to simplify just put "killall firefox" in script. For example

Code: Select all

#/bin/bash
firefox http://myaddress.com
sleep 20
killall firefox
exit
Run this with cron when you want...

dominic
Posts: 336
Joined: Thu Jun 14, 2012 7:19 am

Re: open browser for forecast

Post by dominic » Mon Feb 03, 2014 5:52 pm

hello ivan, I this script I have to enter in the sh when I run the whole process run with the model due to the loading of data and maps online.

I can put it at the end of this piece of code? keep in mind that the script is in tcsh

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

Re: open browser for forecast

Post by meteoadriatic » Mon Feb 03, 2014 7:45 pm

Anywhere you put it must work if that piece of code become executed.

dominic
Posts: 336
Joined: Thu Jun 14, 2012 7:19 am

Re: open browser for forecast

Post by dominic » Mon Feb 03, 2014 8:20 pm

unfortunately crontab refuses to do so to start, but cron works fine for other controls. you work with crontab?

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

Re: open browser for forecast

Post by meteoadriatic » Mon Feb 03, 2014 8:44 pm

dominic wrote:unfortunately crontab refuses to do so to start
What are the symptoms? Some error message?

dominic
Posts: 336
Joined: Thu Jun 14, 2012 7:19 am

Re: open browser for forecast

Post by dominic » Mon Feb 03, 2014 8:51 pm

ivan practically launch if the terminal command, for example. / script.sh the browser opens properly and open tabs.,

but if I set the crontab browser will not open!, the absurd thing is that I open the browser manually closes it to me!, it means that the kill function works

the problem remains that the browser does not open

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

Re: open browser for forecast

Post by meteoadriatic » Mon Feb 03, 2014 9:20 pm

I see, then crontab does start script because kill works, the question is why running firefox doesn't?

It can be because of path. Try to put full path for firefox into script, for example /usr/bin/firefox instead just firefox. Find out correct path with "which firefox".

If still doesn't work, redirect script output to file to debug. In crontab line add after command something like 10 * * * * your_script > /home/username/log_file.txt 2>&1

dominic
Posts: 336
Joined: Thu Jun 14, 2012 7:19 am

Re: open browser for forecast

Post by dominic » Tue Feb 04, 2014 7:30 am

anything does not work, I tried to change it so even using chromium

# / bin / tcsh
export DISPLAY =: 0
xhost localhost
/ usr / bin / chromium-browser http://www.mysite.com
sleep 10
killall chromium-browser



the kill function works correctly, I also tried to set the automatic startup of the browser at system startup. but I do not want to hear you open the card.

the kill function does work because the browser is closed properly after the set period


ps: Which feature chromium-browser or firefox returns the path:

/ usr / bin / firefox


I do not know what to do: (

dominic
Posts: 336
Joined: Thu Jun 14, 2012 7:19 am

Re: open browser for forecast

Post by dominic » Tue Feb 04, 2014 7:46 am

this is the log

(process:8294): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed

Post Reply