run jython script remotely or by cron job
Posted: Mon Oct 08, 2018 2:37 pm
I have a problem which looks very similar to the "mcidas in script mode" thread, (viewtopic.php?f=31&t=1313) but has enough differences it may be less confusing if handled in a separate topic.
I want to run a jython script by cron job using macintosh High Sierra. It will download satellite data and convert it to netcdf, so image production is not needed. To test it I run it remotely to simulate a cron job without an active screen. The script works fine when running it at the terminal, so I'm attaching it for completeness rather than debugging.
I run the script by bash file with pertinent lines below:
----
/opt/X11/bin/Xvfb :1337 -screen 0 640x480x24 -ac -terminate &
export DISPLAY=:1337
/usr/bin/nohup /applications/McIDAS-V-System/runMcV -script ${datafolder}/goes16_download.py
killall -9 Xvfb
exit
----
When I run it at the command line without using Xvbf (virtual frame buffer for X-windows) the McIDAS symbols will pop up in the dock and toolbar, the data explorer and display windows do not pop up but some window flashes briefly before McIDAS closes again. I tried to squelch the McIDAS environment by using Xvbf but it does the same thing. It flawlessly does the work I want but the McIDAS environment is clearly not running completely in background.
When I try running remotely I get no errors, but it hangs up and nothing happens. It may be the 20 minute wait referred to on the previously referenced thread but I haven't had the patience to wait.
Any ideas what can be done so this can be run without needing to sit at the terminal? I need to automate this process.
There may be a way to run headless McIDAS-V using Xquartz, but I'm not as familiar with it. If anyone has such a solution, that would work as well.
Thanks.
I want to run a jython script by cron job using macintosh High Sierra. It will download satellite data and convert it to netcdf, so image production is not needed. To test it I run it remotely to simulate a cron job without an active screen. The script works fine when running it at the terminal, so I'm attaching it for completeness rather than debugging.
I run the script by bash file with pertinent lines below:
----
/opt/X11/bin/Xvfb :1337 -screen 0 640x480x24 -ac -terminate &
export DISPLAY=:1337
/usr/bin/nohup /applications/McIDAS-V-System/runMcV -script ${datafolder}/goes16_download.py
killall -9 Xvfb
exit
----
When I run it at the command line without using Xvbf (virtual frame buffer for X-windows) the McIDAS symbols will pop up in the dock and toolbar, the data explorer and display windows do not pop up but some window flashes briefly before McIDAS closes again. I tried to squelch the McIDAS environment by using Xvbf but it does the same thing. It flawlessly does the work I want but the McIDAS environment is clearly not running completely in background.
When I try running remotely I get no errors, but it hangs up and nothing happens. It may be the 20 minute wait referred to on the previously referenced thread but I haven't had the patience to wait.
Any ideas what can be done so this can be run without needing to sit at the terminal? I need to automate this process.
There may be a way to run headless McIDAS-V using Xquartz, but I'm not as familiar with it. If anyone has such a solution, that would work as well.
Thanks.