Gnome-schedule doesn't execute scheduled tasks

Bug #331742 reported by Michał Gołębiowski-Owczarek
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
gnome-schedule (Ubuntu)
Triaged
Low
Unassigned

Bug Description

Gnome-schedule doesn't execute scheduled tasks at all.

I made one, set it to be run every minute and put there a name of a script that I put in ~/bin directory. It haven't been run even once.

The command is OK - when I press a "Run task" button, the script is executed properly.

OS: Ubuntu 8.04.2
gnome-schedule: 2.0.2-0ubuntu1

Steps to reproduce:
1) put any command in gnome-schedule and set it to be run every minute
2) it won't run even once

Revision history for this message
GauteHope (eg) wrote :

Have you checked that at and crontab is set properly up; have a look at:

http://gaute.vetsj.com/2009/02/20/how-to-figure-out-if-crontab-and-at-is-correctly-set-up/

for some tips.

- gaute

Revision history for this message
Michał Gołębiowski-Owczarek (mgol) wrote :

Yes, it's correctly set up (I have a slight different permissions, but I believe that's ok). The attached example works.

I realised that for some ways it doesn't honour my PATH value. If I enter a full path of the file, it's ok.

Unfortunately, any graphical application doesn't work with that, is that ok? (e.g. gnome-screenshot)

Revision history for this message
Michał Gołębiowski-Owczarek (mgol) wrote :

As for the PATH thing - I think it should be fixed, I'd maybe understand if it didn't look at PATH at all, but it does as if I press a "Run tab" button it runs OK... There's a bit of inconsistency here.

Revision history for this message
GauteHope (eg) wrote :

Fixing the PATH variable would require major change in the way we handle crontab tasks. And I will spend my time fixing the other bugs and planned features rather than reimplementing this. If you or anyone else want to do some work on this I would be happy to support it, and include it if it turns out good.

- gaute

Revision history for this message
Nixblicker (el-lunatico) wrote :

Hello there,

i want to confirm this bug for the above mentioned version- starting my graphical app. via "Run Task" button works, but at the set up time it doesn't do it automatically.
I get this python message, when running gnome-schedule in terminal but i don't think its crucial:
"/usr/share/gnome-schedule/at.py:372: DeprecationWarning: os.popen3 is deprecated. Use the subprocess module.
  child_stdin, child_stdout, child_stderr = os.popen3(execute)"

Additionally, there is a frequent "no crontab for username" message, that is continued, after i set the one-time task up.
This is exactly what i get when i use "crontab -l"

Any progress with this issue?
I would love this nice piece of code to run and auto record tv shows with me-tv.

Cheers and Thanks for programming this,
Nix

Revision history for this message
GauteHope (eg) wrote :

Please check http://gaute.vetsj.com/2009/02/20/how-to-figure-out-if-crontab-and-at-is-correctly-set-up/ for how to check if crontab and at is correctly set up; read the comments as well - there are a few solutions there.

Are you sure you use gnome-schedule as the regular user ?

The command you try to run; is it a system wide program or a custom script ?

If the command shows up in gnome-schedule it has been added, are you trying to add a one-time task or a recurrent one?

One-time tasks are handled by at and you need to make sure it is working. See the page above.
Recurrent by crontab.

- gaute

Revision history for this message
John Barley (strange-cathect) wrote :

I'm having the same problem on a fresh install of Ubuntu 10.04.

I've been trying to get gnome-schedule to perform an automatic backup for me using grsync. However, gnome-schedule will not initiate any scheduled commands.

First, I wrote a script and tried to have gnome-schedule run it. I named a file "backup.sh" and told gnome-schedule where to find it. The script reads:

#!/bin/sh
grsync -e "Internal Backup";
touch test file location;

I can run the script in the terminal fine, but gnome-schedule won't seem to initiate it at the requested time.

After this failed I dispensed with the script file and just created a new task command that reads:

grsync -e "Internal Backup"

Again, I can ask gnome-schedule to run this task successfully by clicking "run task" but it will not run this as a scheduled event.

Help!

Revision history for this message
GauteHope (eg) wrote :

Hello,

What version of Gnome-schedule is this ?

Make sure you use the complete path to the script, ie not ~, but: /home/john/script

Does the script have the executable bit set (+x)?

For any of the above problems; if what you are trying to run, in John's case: grsync, is an graphical application you need to make sure that 'X application' in gnome-schedule has been chosen.

Is this a one-time or recurring task?

Are other tasks running fine? (both one-time and recurring ones)

As always; please make sure crontab and at is set up correctly: http://gaute.vetsj.com/2009/02/20/how-to-figure-out-if-crontab-and-at-is-correctly-set-up.html

- gaute

Revision history for this message
Larry Tate (cathect) wrote :

Gaute,

Thank you for your clue that I need to set this script as an "X application" in the set up of the task. That is EXACTLY what I had done wrong.

Just to let you know: your url you posted is broken...

Thank you for this great program.

Revision history for this message
GauteHope (eg) wrote :

Great! Yeah the first url is broken - the latest one from #8 is the correct one ;)

http://gaute.vetsj.com/2009/02/20/how-to-figure-out-if-crontab-and-at-is-correctly-set-up.html

- gaute

Revision history for this message
Kathryn Jennings (katj) wrote :

I'm having trouble too. I have looked at Gaute's link and was able to get at and cron to execute the test functions.

gnome schedule 2.1.1 with ubuntu 10.04
The command is /usr/bin/grsync -e "default". It is scheduled to run daily and is using the X application option.
The window doesn't show up and the test file that I made has not moved so I know that it hasn't run.
Everything works as expected when I hit the run icon.

Please tell me what other information I should give you so you can assist me.

BTW Gaute,
your page is helpful and easy to understand. nice.

Thanks,
Kathryn

Revision history for this message
Kathryn Jennings (katj) wrote :

OK, I learned how to use cron and something must be broken outside of gnome-schedule. So it is certainly not a bug with you guys.

-Kathryn

Revision history for this message
GauteHope (eg) wrote :

Hey,

Thanks- did you try adding:

  * * * * * echo "Does this work?" > ~/test

manually to your crontab and see if ~/test shows up ?

- gaute

Revision history for this message
quadra (info06) wrote :

Back to the original problem, as reported in post #3 and #7. The fact is that in many cases, we can successfully test a task by clicking "Run selected task", but then, in real life it won't run.
Two main technical reasons:
1) The test is PATH-aware, the real task (using cron) is not
2) The test is insensitive to the output mode ("Default" or "X application"), the real task is not

I think this is indeed a bug worth to be fixed.
At least, the message that appears when testing a task should be improved ("Note about working directory of executed tasks", it is confusing.) Additionally, the "Run selected task" function should be improved.

Revision history for this message
Fabián Rodríguez (magicfab) wrote :

I'd agree this is a usability issue, where the "Run selected task" option should fail gracefully with a clear indication on what to do.

Can someone also reproduce this in Maverick ?

Changed in gnome-schedule (Ubuntu):
status: New → Triaged
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.