I wrote a script that uses pynotify for warning. it works fine when I run it ( python script.py ), but when cron starts with 00 * * * * myname python ~/scripts/script.py it doesn't work! I do not know why. Here is a snippet:
if os.path.isfile(os.path.expanduser('~/.thumbnails/normal')+'/'+thumbnail): n = pynotify.Notification(video_file[0], 'finished download', os.path.expanduser('~/.thumbnails')+'/'+thumbnail) else: n = pynotify.Notification(video_file[0], 'finished download', '/usr/share/icons/gnome/48x48/mimetypes/gnome-mime-application-x-shockwave-flash.png') print n n.show()
redirecting output to ~ / log.file gives: <pynotify.Notification object at 0x16d4e60 (NotifyNotification at 0x13804e0)> and no errors, so I'm not quite sure where else to look.
source share