I placed a command in a script file called app.sh that simply execute an application.
sh app.sh
When I run it with terminal directly works fine!! but when put it under cron does not work..I tired with three ways of actually the same command but different approach(see below commands). It did not work either. What went wrong in the script? Anyone see something?
/opt/extras.ubuntu.com/pushbullet-indicator/bin/pushbullet-indicator
gnome-terminal -x sh -c "/opt/extras.ubuntu.com/pushbullet-indicator/bin/pushbullet-indicator"
exec /opt/extras.ubuntu.com/pushbullet-indicator/bin/pushbullet-indicator
under the crontab -e
*/1 * * * * sh /home/app.sh
cron
is really intended to run non-interactive, backgound jobs: it has a very limited environment, and doesn't know anything about the GUI or desktop session. You may be able to get it to work by exporting theDISPLAY
environment variable - see for example How to start a GUI application from cron?. BTW are you trying to do this from root's crontab or from your user crontab? You may also find Reasons why crontab does not work helpful. – steeldriver Aug 01 '15 at 15:04