notify-send in crontab causes crash

Bug #734009 reported by actionparsnip
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libnotify4 (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: libnotify4

I have made a script:

#!/bin/bash
export EMAILNUM=`curl -u username:password --silent "https://mail.google.com/mail/feed/atom" | tr -d '\n' | awk -F '<entry>' '{for (i=2; i<=NF; i++) {print $i}}' | sed -n "s/<title>\(.*\)<\/title.*name>\(.*\)<\/name>.*/\2 - \1/p" | wc -l`

if [ EMAILNUM == 0 ]; then exit 0
fi

if [ EMAILNUM == 1 ]; then
   notify-send -i /usr/share/app-install/icons/gmail-notify-icon.png "Gmail" "You have 1 new email"
else
   notify-send -i /usr/share/app-install/icons/gmail-notify-icon.png "Gmail" "You have $EMAILNUM new emails"
fi

This runs fine when executed from terminal. I cron'd the script to run every 5 mins with:

*/5 * * * * /usr/bin/andygmail

And every 5 mins the libnotify would create a crash rather than displaying what was intended.

BTW, feel free to use my code :)

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: libnotify-bin 0.7.1-0ubuntu2
ProcVersionSignature: Ubuntu 2.6.38-6.34-generic 2.6.38-rc7
Uname: Linux 2.6.38-6-generic i686
Architecture: i386
Date: Sat Mar 12 20:06:22 2011
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Alpha i386 (20110202)
ProcEnviron:
 LANGUAGE=en_GB:en
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
SourcePackage: libnotify4
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
actionparsnip (andrew-woodhead666) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.