i want to run my bat file with wine. all went well, but when using crontab it did not work
this is my script in crontab
02 21 * * * wine cmd.exe /C /python/newstart.bat
How do you make it work?
i want to run my bat file with wine. all went well, but when using crontab it did not work
this is my script in crontab
02 21 * * * wine cmd.exe /C /python/newstart.bat
How do you make it work?
I have tried to run scripts with wine commands in them. I have managed to get the scripts to run in SSH and in the server console. I have been completely unable to get the scripts to run via cron. It appears that wine commands cannot be run using cron.
The problem is that cron doesn't allow access to the desktop gui, xauth and display, which wine requires. There are (complicated and kludgy) ways of setting that up so you can run wine applications through SSH, but apparently not through cron.
There are ways, other than cron, of having commands run at specific times, such as the "at" command, where wine commands might not fail but you would still have to jump through a lot of hoops. I used a combination of Lutris, gtk-launch and screen to do the trick.
@Kusalananda comment is right and helped me.
In cron you need to use the full path also for commands, like for grep I'am using /usr/bin/pgrep
And for wine you can check with command -v wine
Mine was at /usr/local/bin/wine
, just replace wine
with the full path
wine
located and what is your$PATH
within the crontab? If Wine needs to open a window, there will be further complications (see e.g. https://unix.stackexchange.com/questions/10121). – Kusalananda Apr 17 '20 at 14:38/root/.wine
– R ford Apr 17 '20 at 14:45wine
executable is/root/.wine
or/root/.wine/wine
? Check withcommand -v wine
. What user's crontab are you using? If it's not root, does the user have access to thewine
executable? – Kusalananda Apr 17 '20 at 14:48command -v wine
wine location in/usr/bin/wine
. i'm using root to execut wine. Wine run smoothly, sir, if i runwine cmd.exe /C /python/newstart.bat
– R ford Apr 17 '20 at 14:52