run jython script remotely or by cron job

Post any questions, ideas, or topics related to Jython and Python scripting.
Post Reply
User avatar
brianvh
Posts: 6
Joined: Mon Oct 08, 2018 12:14 pm

run jython script remotely or by cron job

Post by brianvh »

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.
Attachments
goes16_download.py
(959 Bytes) Downloaded 215 times
User avatar
jayh
Posts: 415
Joined: Thu Jan 15, 2009 10:34 pm

Re: run jython script remotely or by cron job

Post by jayh »

Hello brianvh,

My colleague Barry gathered some information about Xvfb and VNC from a systems programmer and McV user who runs McIDAS-V in the background and added it to the "running Mc-V on a remote machine" thread. Please see that thread, since it has a good overview of the issues and has the information Barry gathered this week.

Thanks,
Jay
User avatar
brianvh
Posts: 6
Joined: Mon Oct 08, 2018 12:14 pm

Re: run jython script remotely or by cron job

Post by brianvh »

Thanks Jay - some new stuff in there I don't yet recognize and need to work out. Once I have it working in the OS X environment I'll post, for I feel there may be some slight variations that others may find useful.
User avatar
brianvh
Posts: 6
Joined: Mon Oct 08, 2018 12:14 pm

Re: run jython script remotely or by cron job

Post by brianvh »

Editing my last post: the 'nooneinstance' switch seems to suppress the appearance of the logo in the dock and status bar, but nothing seems to be happening. Since there's no complaint this is progress of a sort. OS X is supposed to have openGL, but I'm getting an error from the +extension GLX switch. Perhaps I need to install something extra?
Post Reply