Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive
 

i got this error message whenever I tried to call zenity in a cron job of a user. I found some hints in the net but still failed. But's its just 2 commands you have to add.

 

 

Add in .bashrc

[[ $DISPLAY ]] && xhost +localhost

Now add following line in the code calling Zenity

DISPLAY=':0.0'

(
  echo "# Backing up user data ..."
  sudo rsnapshot daily
) | DISPLAY=':0.0' zenity --title="Backup running - do not close lid or shut down system" --progress --pulsate --auto-close --width=800 &

 

Add comment

*** Note ***

Comments are welcome. But in order to reject spam posts please consider following rules:
  1. Comments with string http are rejected with message You have no rights to use this tag
  2. All comments are reviewed manually and thus it usually takes one day until a comment will be published.