1

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

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

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!

1
  • 1
    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, 2012 at 19:45

1 Answer 1

1

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.

1
  • thank you, it's working...so simple, sometimes we think that ubuntu, must be more complicated than MSW...that's stupid! ;)
    – DJames
    Jun 14, 2012 at 17:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .