CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > ParaView

[General] cron and Paraview

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 16, 2014, 12:51
Smile cron and Paraview
  #1
Senior Member
 
James
Join Date: May 2013
Posts: 116
Rep Power: 12
Tensian is on a distinguished road
Hi everyone,

I have created a cron that executes a Python script every 30 minutes. The cron in running well except when the script calls to ParaView.

The cron log file shows an error:"Segmentation fault"

All the task are behaving correctly, except those related to handle ParaView.

When I run the script directly fron the terminal:

python script.py

no error message is shown an everything works like expected.

Any ideas? It looks like cron in Ubuntu have problems handling software with graphical interface...

Thanks in advance.
Tensian is offline   Reply With Quote

Old   November 18, 2014, 11:40
Default
  #2
Senior Member
 
Stuart Buckingham
Join Date: May 2010
Location: United Kingdom
Posts: 267
Rep Power: 25
stuart23 will become famous soon enoughstuart23 will become famous soon enough
Hi James,

Cron does not know how to run an application in X because its environment is not inherited from your X instance. The answer is simple, have a look at this page: http://www.codecoffee.com/tipsforlinux/articles/23.html

Good luck,

Stu
stuart23 is offline   Reply With Quote

Old   November 20, 2014, 10:19
Smile
  #3
Senior Member
 
James
Join Date: May 2013
Posts: 116
Rep Power: 12
Tensian is on a distinguished road
Hey Stuart,

Thanks for your reply. The problem is solved. It was related with paths and enviroment variables inside bashrc file.

Best,

James
Tensian is offline   Reply With Quote

Old   November 21, 2014, 17:59
Default
  #4
Senior Member
 
Stuart Buckingham
Join Date: May 2010
Location: United Kingdom
Posts: 267
Rep Power: 25
stuart23 will become famous soon enoughstuart23 will become famous soon enough
Hi James,

Good to hear that you got it sorted. Can you tell us which envvars it was in particular so people who come across this issuel in the future will know?

Thanks

Stu
stuart23 is offline   Reply With Quote

Old   November 24, 2014, 07:02
Smile
  #5
Member
 
Richardpluff
Join Date: May 2014
Posts: 95
Rep Power: 11
CRI_CFD is on a distinguished road
Please tell us how you did it, I had a similar problem in the past. How have you solve it?
CRI_CFD is offline   Reply With Quote

Old   November 24, 2014, 07:10
Cool
  #6
Senior Member
 
James
Join Date: May 2013
Posts: 116
Rep Power: 12
Tensian is on a distinguished road
Sorry for the delay, I have absolutely forgotten this thread...

The problem was path and environment variables, in the following sense:

I have ParaView binaries in my desktop and in the system folder I have previous versions of Paraview.

When I ran my script directly using the terminal, the bashrc file has the information of path and environment variables (related to Python and Paraview) needed for a good behaviour of the script (path to desired version of Paraview, path to Python...)

When cron executes, this content seem to remain unknown, so the script tries to use an older version of ParavIew (which is partially deleted, I hae a little mess with this).

Solutions:1) include paths and environment variables in the cron or 2)create another script (.sh) that first of all execute the bashrc and later call the python script. In this case, the cron should call my_script.sh and my_script.sh should execute bashrc and my_python_srcipt.py in this order.

Hope this could help! If I could provide something more, please continue with this thread and I'll answer asap...

Regards,

J
Tensian is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 13:53.