LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   at and cron not working (http://www.linuxquestions.org/questions/linux-general-1/at-and-cron-not-working-531022/)

cad 02-21-2007 08:51 AM

at and cron not working
 
both atd and crond are running but neither works for me.
what do I do
when I run at it shows the process in the list but then when the time of running the program passes off it doesn't show anything in the list
Please help.

colucix 02-21-2007 03:42 PM

Maybe some more details will be useful. For example, which is the command issued in the at job? Can you try something as simple as
Code:

at now + 1 minute
at> date > /tmp/testfile
at> <Ctrl-D>

and post the result of
Code:

cat /tmp/testfile
here?

cad 02-22-2007 10:32 AM

Hey this does display the correct thing but when i say
at now + 1 minute
at>/usr/bin/gedit
it doesn't start

colucix 02-22-2007 04:42 PM

Ok. If the above test was successfull, it means that at is working and the atd daemon is running. Maybe a simple test like this works with cron, too. The problem resides in the command you issued inside the jobs. In your example /usr/bin/gedit cannot work simply because at jobs don't have any DISPLAY assigned, that is they are meant to work as non-interactive jobs. This implies that no graphical application can be run from at or cron jobs.
Actually, this is not quite true, because with a little or great effort (depending on the purpose and conditions of the job) you can try to assign a DISPLAY automagically. But this is another story...
Regarding the at job with /usr/bin/gedit, please try to issue
Code:

mail
from the command line (logged as the user that launched the at job). Check the mail headers and find a message with something like "Output from your job" in the subject. Inside the message you will find an error similar to
Code:

cannot open display: (null)
Run '/usr/bin/gedit --help' to see a full list of available command line options.

This is very useful for debugging purposes, because cron and at jobs send their standard error and standard output to the user by mail (or at least this is the default behaviour) unless both the standard error and the standard output are redirected to a file or device.
Hope this will help! :)


All times are GMT -5. The time now is 03:14 AM.