LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Linux Mint-18 zenity-notification hangs my backup Shell Script (https://www.linuxquestions.org/questions/programming-9/linux-mint-18-zenity-notification-hangs-my-backup-shell-script-4175586843/)

WildDrake! 08-11-2016 05:43 PM

Linux Mint-18 zenity-notification hangs my backup Shell Script
 
LM-18 Cinnamon
Custom Built 64 bit AMD 8-Core 4 GHz with twin 2TB drives, one drive is Primary and the other is my Backup drive of the first drive.
I am a novice at shell scripting.

In 2014 I found a 'rsync' shell script on the Internet and I customized it to back up my primary drive to my backup drive (both drives are on the same machine) using 'cron' each day. My script has been running fine since as I moved to each new version of LM. However, I converted to LM-18 in mid July and my backup routine hangs when it reaches my user Notification statement that a backup is about to begin. That statement uses 'zenity' which is the notification system on Ubuntu/LM. Here is the one line statement I make in my shell script:

Code:

echo 'message:ALERT! Backup Procedures Now In Progress!' | zenity --notification --timeout=10 --listen
Testing my script from the command line I get:

Code:

$ sudo ./backup_local.sh
-which returns:

Code:

** (zenity:16479): WARNING **: Error showing notification: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Notifications was not provided by any .service files
-and then it hangs so that the terminal does not come back to '$' prompt again.

I should note that the Notification does indeed pop up on the user's screen, but the above statement has hung the program at that point.

So far I haven't found an answer to this. Does anyone know why this isn't allowing my shell script to continue on it's merry way? -and how to fix it?

Thanks for your help!

RockDoctor 08-14-2016 11:22 AM

I'm not a zenity expert, but it appears that the --listen option induces the problem. This works - does it do what your want?
Code:

zenity --notification --timeout=10 --text='ALERT! Backup Procedures Now In Progress!'

WildDrake! 08-14-2016 01:58 PM

Thanks for the suggestion RockDoctor!

The Good News is: The program runs all the way through.

The Bad News is: Zenity completely fails to show it's text notification message on my desktop.

So, better but not there yet.


All times are GMT -5. The time now is 12:42 PM.