Wine在crontab中不起作用

cron脚本中有bash,执行wine。 在cronjob日志中我看到:

wine: Unhandled exception 0x0eedfade in thread 9 at address 0xce99ebf0:0x7b83e6ce (thread 0009), starting debugger... err:winediag:nulldrv_CreateWindow Application tried to create a window, but no driver could be loaded. err:winediag:nulldrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly. err:seh:setup_exception_record stack overflow 928 bytes in thread 0009 eip 7bc843a0 esp 00230f90 stack 0x230000-0x231000-0x330000 

我尝试了两种方法来避免这个问题,但没有人工作。

1)在bash脚本中:

 DISPLAY= wine my_program.exe 

2)在crontab中

 52 15 * * * export DISPLAY= && bash myscript.sh >> /var/log/mylog.log 2>&1 

如何解决这个错误?

二元wine意味着graphics程序,它需要一个X服务器来运行。 如果您的程序没有graphics界面,请改用wineconsole

 wineconsole my_program.exe