1

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
Evan S
  • 377
  • 2
  • 6
  • 14
  • possible duplicate of [Script not working through Cron - JDK version mismatch between shell and script](http://askubuntu.com/questions/106066/script-not-working-through-cron-jdk-version-mismatch-between-shell-and-script) – l0b0 Aug 01 '15 at 14:23
  • `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 the `DISPLAY` environment variable - see for example [How to start a GUI application from cron?](http://askubuntu.com/questions/514167/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](http://askubuntu.com/questions/23009/reasons-why-crontab-does-not-work) helpful. – steeldriver Aug 01 '15 at 15:04

0 Answers0