I am trying to write a cron script that pulls the current version of a zim 
notebook from git and then generates (exports) the HTML pages in /var/www/html 
to be served up by httpd.

I have a simple script:
  # do a git pull to update notebook
  (cd $SRC; git pull -q origin)
  # do a zim export to generate static web pages
  zim --export --format=html --index-page=index.html \
    --root-url=http://example.com/Notebook/ \
    --output=$DEST $SRC

If I log in to my remote server with the -Y flag to enable a remote X display:
  ssh -Y harker.com
And run the command manually, everything works

But if I try and run the script via cron or if I just do a simple ssh without 
the -Y flag I get the error:
  RuntimeError: could not open display

Is there a work around for this?


Complete python error:
zim --export --format=html --output=/var/www/html/Notebook ~/Notebook/ 
Traceback (most recent call last):
  File "/usr/bin/zim", line 74, in <module>
  File "/usr/lib/python2.6/site-packages/zim/__init__.py", line 391, in main
    handler = NotebookInterface(notebook=args[0])
  File "/usr/lib/python2.6/site-packages/zim/__init__.py", line 575, in __init__
  File "/usr/lib/python2.6/site-packages/zim/__init__.py", line 584, in 
    import zim.plugins
  File "/usr/lib/python2.6/site-packages/zim/plugins/__init__.py", line 36, in 
    from zim.actions import action, toggle_action, get_actiongroup
  File "/usr/lib/python2.6/site-packages/zim/actions.py", line 26, in <module>
    import gtk
  File "/usr/lib64/python2.6/site-packages/gtk-2.0/gtk/__init__.py", line 64, 
in <module>
  File "/usr/lib64/python2.6/site-packages/gtk-2.0/gtk/__init__.py", line 52, 
in _init
RuntimeError: could not open display

Mailing list: https://launchpad.net/~zim-wiki
Post to     : zim-wiki@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zim-wiki
More help   : https://help.launchpad.net/ListHelp

Reply via email to