Warning

 

Close
Confirm Action

Are you sure you wish to do this?

Cancel Confirm
AR15.COM
6/20/2015 10:46:03 PM EDT
I'm using Mint 17.1 on one computer and need to run a program, "wine "/home/david/.wine/drive_c/Program Files (x86)/Binreader/Binreader.exe"" automatically from 12:10am to 5:00am each day with it being killed at 5:00am. Google has not been my friend and Gnome Scheduler doesn't work with it. I have satellite internet and from 12:am to 5:00am is the free time.  This is so simple in Windows Scheduler but so far doing this in Linus has beat me.
6/20/2015 10:48:40 PM EDT
[#1]
http://www.unixgeeks.org/security/newbie/unix/cron-1.html

Setup two cron jobs. One to start it and one to kill it,
6/20/2015 10:53:54 PM EDT
[#2]
Quote History
Quoted:
http://www.unixgeeks.org/security/newbie/unix/cron-1.html

Setup two cron jobs. One to start it and one to kill it,
View Quote


I've been trying this all day and it does nothing. I found something somewhere that said cron won't work with a GUI on recurring tasks.
6/20/2015 11:06:38 PM EDT
[#3]
This might help: http://ubuntuforums.org/showthread.php?t=185993

It sounds like you need to export the DISPLAY variable along with the command. Try adding these to crontab:

10 0 * * * export DISPLAY=:0 && wine "/home/david/.wine/drive_c/Program Files (x86)/Binreader/Binreader.exe"
0 5 * * * killall wine
6/20/2015 11:41:14 PM EDT
[#4]
Quote History
Quoted:
This might help: http://ubuntuforums.org/showthread.php?t=185993

It sounds like you need to export the DISPLAY variable along with the command. Try adding these to crontab:

10 0 * * * export DISPLAY=:0 && wine "/home/david/.wine/drive_c/Program Files (x86)/Binreader/Binreader.exe"
0 5 * * * killall wine
View Quote View All Quotes
View All Quotes
Quote History
Quoted:
This might help: http://ubuntuforums.org/showthread.php?t=185993

It sounds like you need to export the DISPLAY variable along with the command. Try adding these to crontab:

10 0 * * * export DISPLAY=:0 && wine "/home/david/.wine/drive_c/Program Files (x86)/Binreader/Binreader.exe"
0 5 * * * killall wine


Doesn't work. I've been using Gnome Schedule, but I checked in crontab to make sure the above was put in it by Gnome Schedule (well the above with the time changed to one minute from when I wanted to see if it worked). I found this in the Gnome Schedule docs -

Gnome Schedule does not support yet setting environment variables for recurrent tasks, but it will do soon. In the meantime, you can manually create a script that first defines DISPLAY variable and then calls the graphical application. Finally, you can create a recurrent task to launch the script.


I have no idea how to write a script to do this.
6/20/2015 11:42:03 PM EDT
[#5]
From a terminal type crontab -e, add the lines I posted and save the file
6/20/2015 11:50:42 PM EDT
[#6]
Quote History
Quoted:
From a terminal type crontab -e, add the lines I posted and save the file
View Quote


They were already there fron where I was using Gnome Schedule. I just change the time one minute up from the current time a couple times in crontab to see if it would work. It didn't.
6/20/2015 11:53:17 PM EDT
[#7]
Maybe try adding the full path of the wine command
6/20/2015 11:58:51 PM EDT
[#8]
I just saw something that doesn't look right. The file that Gnome Schedule evidently wrote to and crontab is opening and writing to by default is "/tmp/crontab.D90Fls/crontab". Is this the right file????
6/21/2015 12:02:37 AM EDT
[#9]
Quote History
Quoted:
Maybe try adding the full path of the wine command
View Quote


What I had already looks like the full path??

Edit - Oh, the wine command. It works everywhere else with just wine.
6/21/2015 12:04:04 AM EDT
[#10]
Quote History
Quoted:


What I had already looks like the full path??
View Quote View All Quotes
View All Quotes
Quote History
Quoted:
Quoted:
Maybe try adding the full path of the wine command


What I had already looks like the full path??


The full path to the wine command, type 'which wine' and then replace that where you just have "wine"
6/21/2015 12:13:05 AM EDT
[#11]
GOT IT!!!!  

After a 100 Google pages today I finally found it. It needs an export in front of DISPLAY.

export DISPLAY=:0 && wine "/home/david/.wine/drive_c/Program Files (x86)/Binreader/Binreader.exe"

Thanks, you got me to the DISPLAY, and I found it from there.

Somehow, even though I thought I just copied and pasted your line, I missed the export.
6/21/2015 12:22:18 AM EDT
[#12]
Linus wins! I am using a live instance of Zorin_OS at the moment, its like what Mint used to be like... but with a way better desktop & not so bloated out of the box.
6/23/2015 8:15:20 PM EDT
[#13]
Late to the party but glad it's working. Export is how you set an environment variable in Linux.