Cron issues

Fadookie

New member
I'm trying to write a cron job that will run my breakfast routine for me while I'm on vacation, but it doesn't work.

Here's how I call the program:
java -Djava.awt.headless=true -Duser.home=/home/eliot/games/kol -Duser.dir=/home/eliot/games/kol -jar /home/eliot/games/kol/KoLmafia.jar script=/home/eliot/games/kol/scripts/fadookie_breakfast.cli --CLI &

When I redirect stderr to a file, it says this:
KoLmafia v12.4
Running on Linux
Using Java 1.5.0_10

password:
Validating login server...
Sending login request...
Encountered error in login.
>

The bizzare part is that the program runs fine when I type the same thing into the shell, just not when I'm trying to make cron do the exact same thing. I wasn't even getting any output at all until I added the headless argument.

Any advice? I'll probably be gone before I can get it working, oh well. :-\
 
You'd think, but ps shows that cron is running the job under my account.

The only thing I can think of is that maybe it's not finding the settings folder since it's in ~/.kolmafia instead of ~/games/kol/settings ? I'll try making a symlink just in case.
 
Argh... now I realize I get the login error when I try to run java headless normally in the shell. But I have to use that in order for java to run under cron at all. :(
 
Ah, looks like KoLmafia didn't run in headless mode after all. This should be fixed and the fix will be available in the next release.
 
I use cron for my breakfast routines as well, but never had to use any sort of headless option. I've got the command I use to start KoLmafia in a shell script in /home/me/bin, which simply executes:

Code:
/home/me/Programs/Java/jre1.6.0_03/bin/java -Duser.dir=/home/me/.kolmafia -jar /home/me/Programs/KoLmafia.jar --CLI < /home/me/.kolmafia/scripts/daily/aphroguy.txt

aphroguy.txt logs me into the CLI automatically, then calls my breakfast.ash script to be run. Been working fairly solid for me for quite some time; and as I said, never used the headless mode.
 
That must be my problem then, I should have set -Duser.dir to ~/.kolmafia instead of the path to the KoLmafia.jar file. I'll try that out in a bit, it will probably work.
 
Back
Top