LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 02-21-2007, 08:51 AM   #1
cad
Member
 
Registered: Dec 2006
Distribution: Fedora core 4
Posts: 92

Rep: Reputation: 15
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.
 
Old 02-21-2007, 03:42 PM   #2
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
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?
 
Old 02-22-2007, 10:32 AM   #3
cad
Member
 
Registered: Dec 2006
Distribution: Fedora core 4
Posts: 92

Original Poster
Rep: Reputation: 15
Hey this does display the correct thing but when i say
at now + 1 minute
at>/usr/bin/gedit
it doesn't start
 
Old 02-22-2007, 04:42 PM   #4
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
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!

Last edited by colucix; 02-22-2007 at 04:44 PM.
 
  


Reply

Tags
at, cron


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
cron not working from crontab nor form /etc/cron/cron.d. What did SuSE change? JZL240I-U Suse/Novell 11 01-04-2007 01:57 AM
cron is not working somsahi Linux - Software 12 10-06-2006 04:09 PM
Cron not seeming to be working? MadCactus Red Hat 2 09-09-2006 11:31 AM
Cron not working robbiemorgan Linux - Newbie 6 09-16-2004 10:47 AM
Cron/at not working Wynd Linux - General 1 09-11-2003 11:22 PM


All times are GMT -5. The time now is 09:40 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration