Registered Member
|
I am trying to start kmail via cron but I can't get kmail to start, here is what
cron looks like mit@Titan:~$ crontab -l # Stop kmail 0 5 * * * killall -9 kmail # start kmail 15 5 * * * /usr/bin/kmail --check # This file was written by KCron. Copyright (c) 1999, Gary Meyer # Although KCron supports most crontab formats, use care when editing. # Note: Lines beginning with "#\" indicates a disabled task. On the start Kmail line I have tried the following wording kmail "kmail" 'kmail' /usr/bin/kmail kmail -caption "%c" %i %m (this is the command from the start menu kmail icon) Basicly kmail is killed at 5:00am everyday and I want kmail to start again at 5:15am everyday, but kmail won't start. I am using KDE 3.5.10 and Kmail 1.9.9 on Mepis 8 (Debian Lenny) The reason for this is that my PC runs 24\7 and I collect from several e-mail accounts, but sometime one of them goes awol and I won't get any mail through. But when I close down kmail or reboot and then restart kmail there is a deluge of mail from that particular box Any suggestion?? Tim |
Manager
|
iirc the problem is cron executes in a non windowed environment (not in your kde session) so you can't run kde/gnome apps from cron but you can run them from kalarm (assuming there's an existing kde session for it to execute the program in). Just create a command alarm at 5:15am and set recurrence to daily.
|
Registered Member
|
Thanks Google, I installed and setup kalarm and kmail was up and running ok this morning.
I assume the fact that I can type kmail into konsole and it will start kmail is the fact that konsole is running within a KDE enviroment and as you suggest cron is working outside of the kde enviroment? Tim |
Moderator
|
The first graphical session you start is normally available with Ctrl+Alt+F7. You can switch to terminals with Ctrl+Alt+F1,F2,F3 up to F6. Ctrl+Alt+F8 would be a new graphical session, if you start one.
If you execute this on a terminal you can access through Ctrl+Alt+F2 or one of the other F-keys the application will start on your graphical session:
In Konsole the environment variable DISPLAY is set. You can see this by executing
If you use the following as cron command for KMail it should start in your graphical session:
|
Registered Member
|
|
Moderator
|
No problem
Could you mark the topic as solved please (press the green hook at the post which solved your problem)? Thanks. |
Registered users: Bing [Bot], Evergrowing, Google [Bot]