1

Have been trying to create a daily task to open GUI program (for the sake of argument say it is firefox) using crontab but I am not succeeding. At least I can't tell as no message is sent to terminal.

I have followed the instructions from these sites:

to no avail.

Juan Antonio
  • 1,572
  • http://askubuntu.com/questions/514167/how-to-start-a-gui-application-from-cron/514172#514172 Refer to this, You will find your answer. – Rohitt Vashishtha Oct 24 '16 at 16:21
  • @RohittVashishtha I just tried this:

    sudo crontab -u username -r to delete what I had.

    Then sudo crontab -u username -e to create and edit a new crontab for username. At the end of the filed I added:

    52 13 * * * DISPLAY=:0 firefox. I added this at 13:50 my time but at 13:52 nothing happened.

    – Juan Antonio Oct 24 '16 at 16:58
  • While I was waiting for an answer, something interesting happened. The script setup through crontab actually ran! It turns out that it seems to to be using the time of day without considering the summer time. That is, it is taking the time as a fixed time from UTC not considering that it is still summer time.

    The issue about not being able to install gnome-schedule still remains. I recognise this is a different issue so I will be removing this from here and asking this in a different question.

    – Juan Antonio Oct 24 '16 at 18:45
  • So,... cron doesn't play nice with timezones, eh? Sad. – Rohitt Vashishtha Oct 25 '16 at 07:25

1 Answers1

1

While waiting for an answer on why the crontab event was not running something interesting happened: the script setup through crontab actually ran! It turns out that it seems to to be using the time of day without considering the summer time. That is, it is taking the time as a fixed time from UTC not considering that it is still summer time.

As an example, the task that was setup as:

52 13 * * * /home/username/my_script.sh

actually ran at 14:52 (that is what the clock at the top right corner of my screen said). Because we are still in summer time, I am concluding that cron actually looks at the system clock and ignores the fact that we have added one hour due to summer time. Using @Rohitt Vashishtha words: cron doesn't play nice with timezones.

Juan Antonio
  • 1,572