Results 1 to 3 of 3

Thread: cron and notify

  1. #1
    Join Date
    Aug 2012
    Beans
    4

    cron and notify

    Hi there,

    I'm trying to create a cron job that displays a text bubble every minute. I've found notify-osd to work quite well.

    I created a Script called test.sh

    Code:
    #!/bin/bash
    /usr/bin/notify-send "Example Message" -t 2000
    It works when I run it manually.

    However, I can't get cron to run it for me every minute. My Cron configuration is:

    Code:
    * * * * * DISPLAY=0.0 /home/pco052/Scripts/test.sh >> /home/pco052/check.log 2>&1

  2. #2
    Join Date
    Jun 2009
    Location
    0:0:0:0:0:0:0:1
    Beans
    5,176
    Distro
    Kubuntu

    Re: cron and notify

    Code:
    * * * * * /home/pco052/Scripts/test.sh >> /home/pco052/check.log
    Code:
    #!/bin/sh
    DISPLAY=":0.0"
    export DISPLAY
    notify-send "Example Message" -t 2000
    Laptop: ASUS A54C-NB91 (Storage: WD3200BEKT + MKNSSDCR60GB-DX); Desktop: Custom Build - Images included; rPi Server
    Putting your Networked Printer's scanner software to shame PHP Scanner Server
    I frequently edit my post when I have the last post

  3. #3
    Join Date
    Aug 2012
    Beans
    4

    Re: cron and notify

    awesome it works!!

    I noticed you put the display in the script instead of inside cron, is there a reason for that?

    Also what does display exactly do? Thanks for making it work!

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •