Jump to content

Crontab and kalarm


Recommended Posts

Hi Guys,

I am trying to configure a personal crontab for using kalarm. Kind of b-day reminders.

 

kalarm "this is my message"

from the command prompta works good - it displays the window with the text inside - what I want.

however when I put it in a personal crontab and try to run it from webmin - to see if it works it gives me error.

 

Output from command /usr/bin/kalarm "imash rojden den" ..

 

Aborting. $HOME is not set.

ERROR: KUniqueApplication: Pipe closed unexpected.

any ide how can I fix this?

 

0 10,14 22 1 * /usr/bin/kalarm "imash rojden den"

this is the line from the crontab file (it is not the main one - /etc/crontab but a personal one that executes the command as myself)

 

Thanks

bojo

Link to comment
Share on other sites

Hi Guys,

I am trying to configure a personal crontab for using kalarm. Kind of b-day reminders.

cron runs in it's own environment, if you want to run a graphical application from cron you'll need to provide that particular environment some variables it doesn't have but it needs to succeed. For example, if you are setting a system crontab for launching kalarm in your particular user's running desktop you'll need to tell cron where to run (the display) and who owns it. For example this might work (since "su - USER" launches a USER's login shell (with all the USER environment), also you'll need to provide the display where X is running):

 

# normal system crontab.
# launching kalarm into user Foo's desktop:
*/5 * * * * su - Foo -c 'DISPLAY=:0.0 kalarm "this is my message"'

 

There are different ways of doing the same, but IMHO this one is the easier to understand. See "man su", "man 5 crontab" and "man X" for details.

 

HTH

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...