LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 08-13-2012, 07:06 AM   #1
figure20012
Member
 
Registered: Apr 2012
Posts: 75

Rep: Reputation: Disabled
crontab not executing command


i have placed the following line in the crontab file
crontab -e

and then
in the crontab file
57 14 * * * ls /home
 
Old 08-13-2012, 08:10 AM   #2
ted_chou12
Member
 
Registered: Aug 2010
Location: Zhongli, Taoyuan
Distribution: slackware, windows, debian (armv4l GNU/Linux)
Posts: 421
Blog Entries: 28

Rep: Reputation: 2
not sure what dist u have, can you post the output of "crontab -l" and show us your etc directory?
 
Old 08-13-2012, 09:41 AM   #3
suicidaleggroll
Senior Member
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 3,143

Rep: Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108
How do you know it's not running?
 
Old 08-13-2012, 12:35 PM   #4
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,565

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
Quote:
Originally Posted by figure20012 View Post
i have placed the following line in the crontab file
crontab -e

and then
in the crontab file
57 14 * * * ls /home
that will not display anything on your screen. you can check to see if is running by looking in /var/log/cron/

you can edit that file as root and look for the 2:57pm time stamp. it will show you there if it ran.
 
Old 08-13-2012, 01:05 PM   #5
Lythix1
LQ Newbie
 
Registered: Aug 2012
Posts: 2

Rep: Reputation: Disabled
I think you're supposed to redirect the output somewhere. Try the following entry instead

57 14 * * * ls /home >> home.log

Then when you open home.log you will see the output of this command.
 
1 members found this post helpful.
Old 08-15-2012, 11:44 AM   #6
figure20012
Member
 
Registered: Apr 2012
Posts: 75

Original Poster
Rep: Reputation: Disabled
can i redirect the output to my terminal ?
 
Old 08-15-2012, 11:49 AM   #7
Lythix1
LQ Newbie
 
Registered: Aug 2012
Posts: 2

Rep: Reputation: Disabled
I don't think so off the top of my head. I think the Crontab Deamon sort of acts like its own session so you wouldn't see it just as if you wouldn't see the output of another user logged in at the same time as you running the command. Is there a reason you don't want it directed to a file? In all my servers I direct output to log files (half the reason i love linux)
 
2 members found this post helpful.
Old 08-15-2012, 02:07 PM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 12,059

Rep: Reputation: 759Reputation: 759Reputation: 759Reputation: 759Reputation: 759Reputation: 759Reputation: 759
It is possible to run GUI apps if you tell cron to use a display. Assuming you are running a desktop the general command is:

57 14 * * * DISPLAY=:0.0 /my/GUI/app

Is this a homework problem?
 
1 members found this post helpful.
  


Reply

Tags
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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Crontab not executing shell when date is added Jakkie Linux - Newbie 14 02-15-2012 06:18 AM
[SOLVED] Crontab not executing specific script abdoullah Linux - General 3 06-17-2011 03:15 PM
Seems crontab is not executing script... jonaskellens Linux - Newbie 3 11-18-2010 09:20 AM
crontab job not executing.... mia_tech Linux - Newbie 6 08-31-2009 03:42 PM
Command for executing C program in crontab bhandu Linux - Newbie 1 07-14-2007 01:54 PM


All times are GMT -5. The time now is 07:45 PM.

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