Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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!

share|improve this question
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 W. Jun 12 '12 at 19:45

1 Answer 1

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 working...so simple, sometimes we think that ubuntu, must be more complicated than MSW...that's stupid! ;) –  DJames Jun 14 '12 at 17:42

Your Answer

 
discard

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.