Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 27th June 2012, 10:37 PM
clapclash Offline
Registered User
 
Join Date: Oct 2010
Posts: 9
macossafari
Cron not displaying jobs

Hi everyone! I'm running fedora 15, cron is running and I'm trying to execute a simple date command in a crontab that should run every minute but unfortunately it doesn't.
This is the output from /var/log/cron:
Jun 27 22:33:01 sonda /USR/SBIN/CROND[2834]: (sonda) CMD (date)

checking the user email i got this:
From sonda@sonda.localdomain Wed Jun 27 22:33:02 2012
Return-Path: <sonda@sonda.localdomain>
Received: from sonda.localdomain (localhost.localdomain [127.0.0.1])
by sonda.localdomain (8.14.5/8.14.5) with ESMTP id q5RLX2Mi002837
for <sonda@sonda.localdomain>; Wed, 27 Jun 2012 22:33:02 +0100
Received: (from sonda@localhost)
by sonda.localdomain (8.14.5/8.14.5/Submit) id q5RLX2Cc002835;
Wed, 27 Jun 2012 22:33:02 +0100
Date: Wed, 27 Jun 2012 22:33:02 +0100
Message-Id: <201206272133.q5RLX2Cc002835@sonda.localdomain>
From: sonda@sonda.localdomain (Cron Daemon)
To: sonda@sonda.localdomain
Subject: Cron <sonda@sonda> date
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/home/sonda>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=sonda>
X-Cron-Env: <USER=sonda>

Wed Jun 27 22:33:01 BST 2012


Now the question is: why cron displays the date in a mail and not using a terminal???
Reply With Quote
  #2  
Old 28th June 2012, 06:54 AM
marko's Avatar
marko Offline
Registered User
 
Join Date: Jun 2004
Location: Laurel, MD USA
Posts: 5,488
linuxfirefox
Re: Cron not displaying jobs

Quote:
Now the question is: why cron displays the date in a mail and not using a terminal???
Do you mean you literally want a terminal window to appear each minute and show the current date command?

Would you post the crontab line here that you tried to run and state what you want to do?
Reply With Quote
  #3  
Old 28th June 2012, 10:01 AM
george_toolan Offline
Registered User
 
Join Date: Dec 2006
Posts: 1,755
linuxfirefox
Re: Cron not displaying jobs

Because cron doesn't have a terminal ;-)

Try

Code:
while true; do date; sleep 60s; done
Reply With Quote
  #4  
Old 28th June 2012, 02:01 PM
clapclash Offline
Registered User
 
Join Date: Oct 2010
Posts: 9
macossafari
Re: Cron not displaying jobs

Thanks for the reply, I know cron doesn't have any terminal, that's why I tried to launch an xterm followed by date command but with no result.
Reply With Quote
  #5  
Old 28th June 2012, 03:19 PM
jpollard Offline
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,150
linuxfirefox
Re: Cron not displaying jobs

It also has no display.

Sometimes you can get around that with "xterm -display :0.0" but that doesn't always work as the actual display you may be using varies.

Right now (F16) for some reason the users logged in display is 1.0, but sometimes (usually right after a boot) it is 0.0.

It will also fail if you aren't logged in.

---------- Post added at 10:19 AM ---------- Previous post was at 10:14 AM ----------

BTW, something I also forgot to mention.

If the command you run in cron is "xterm -display :0.0 date" then the best you will get is a flicker.

The xterm terminal emulator terminates when the command it is using (the date) exits. So you won't really see anything.

Last edited by jpollard; 28th June 2012 at 03:15 PM. Reason: inadvertent uppercase in "-display"
Reply With Quote
  #6  
Old 28th June 2012, 03:26 PM
sea's Avatar
sea Offline
"Shells" (of a sub world)
 
Join Date: May 2011
Location: Helvetic Federation (Swissh)
Age: 33
Posts: 2,647
linuxchrome
Re: Cron not displaying jobs

As an idea, you could redirect the output to a file, and open that instead?
__________________
Notebook: Samsung NC210/NC110 CPU: Intel 2*1600 Mhz RAM: 1024 MB DDR2 OS: Fedora 19 DE: Awesome
Laptop: Toshiba Satellite L670 CPU: Intel(r) 2*1872 Mhz RAM: 3072 MB DDR3 OS: Fedora 17 DE: Awesome
Fedora Manual (RTFM) | The Linux Documentation Project | Script-Tools
Reply With Quote
  #7  
Old 28th June 2012, 03:39 PM
jpollard Offline
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,150
linuxfirefox
Re: Cron not displaying jobs

A thought.

If all you are trying to do is explore how cron operates, you could do something slightly different.

After logging in, start a terminal window, and use the "tty" command to identify it. It will show a path like "/dev/pts/2".

Then edit the cron entry and change the command to "date >/dev/pts/2"

Wait a bit and the date should start coming up every minute or so. Some delays can be expected, and sometimes missing due to:

1) too many cron jobs occuring at once (not usually, but does happen sometimes)
2) delayed due to large number starting at once.

Expected variations should be within 5 seconds though.

Oh - be sure to remove the cron job before you terminate the terminal window. You might get surprised the next time you open a window and start doing something else.
Reply With Quote
  #8  
Old 29th June 2012, 05:09 PM
clapclash Offline
Registered User
 
Join Date: Oct 2010
Posts: 9
macossafari
Re: Cron not displaying jobs

jpollard thank u very much! Your solution is working and it's really interesting as well!!!
Reply With Quote
Reply

Tags
cron, displaying, jobs

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] No output from cron jobs in /etc/cron.daily marriedto51 Using Fedora 3 3rd February 2011 11:57 AM
Cron Jobs webmastadj Using Fedora 7 26th June 2008 02:37 AM
cron jobs - help joshua197 Using Fedora 2 27th March 2007 01:09 PM
Cron Jobs engrkhalid Using Fedora 3 30th August 2005 06:21 PM


Current GMT-time: 20:56 (Wednesday, 19-06-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat