Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to run this script everytime computer starts up. I'm using crontab/gnome schduler:

while true
    fileName=$(inotifywait -e create /home/posto-11v/Documents/Processo | sed -r 's/^.*CREATE(,ISDIR)*\s+(.*)$/\2/g')
    zenity --warning --text="$fileName"

this is the crontab -e file:

@reboot sh /home/posto-11v/Documents/personaproject/Programa/scripts/recebe_processo # JOB_ID_9

I've changed script permissions using chmod +x.

I'm not able to run it automatically, only by hand. what i'm doing wrong? Can the script start whithout starting the terminal?

thks in advance!

share|improve this question
You should have mentioned it requires a GUI. If it requires a GUI, then you can't use crontab or rc.local to run it. Read @Gilles answer for more details – Thomas Ward Jun 12 '12 at 19:45
up vote 1 down vote accepted

This script can't be executed at reboot: it needs a graphical environment. You need to log in first, to start a graphical environment where you can run zenity. Run the script from your session startup. See Adding programs to session startup in the Ubuntu community documentation.

share|improve this answer
thank you, it's simple, sometimes we think that ubuntu, must be more complicated than MSW...that's stupid! ;) – DJames Jun 14 '12 at 17:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.