I am trying to automate QGIS (2.18.4) standalone scripts in ubuntu using crontab. My scripts execute well when running from command, but fail if I put in crontab.
from qgis.core import *
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from qgis.gui import *
app = QApplication([])
QgsApplication.setPrefixPath("/usr", True)
QgsApplication.initQgis()
In crontab, it fails at app = QApplication([])
. Crontab gives error as
: cannot connect to X server
How to make my QGIS standalone script run in crontab?