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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
08-13-2012, 06:06 AM
|
#1
|
Member
Registered: Apr 2012
Posts: 75
Rep: 
|
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
|
|
|
08-13-2012, 07:10 AM
|
#2
|
Member
Registered: Aug 2010
Location: Zhongli, Taoyuan
Distribution: slackware, windows, debian (armv4l GNU/Linux)
Posts: 431
Rep:
|
not sure what dist u have, can you post the output of "crontab -l" and show us your etc directory?
|
|
|
08-13-2012, 08:41 AM
|
#3
|
LQ Guru
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573
|
How do you know it's not running?
|
|
|
08-13-2012, 11:35 AM
|
#4
|
Senior Member
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,992
|
Quote:
Originally Posted by figure20012
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.
|
|
|
08-13-2012, 12:05 PM
|
#5
|
LQ Newbie
Registered: Aug 2012
Posts: 2
Rep: 
|
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.
|
08-15-2012, 10:44 AM
|
#6
|
Member
Registered: Apr 2012
Posts: 75
Original Poster
Rep: 
|
can i redirect the output to my terminal ?
|
|
|
08-15-2012, 10:49 AM
|
#7
|
LQ Newbie
Registered: Aug 2012
Posts: 2
Rep: 
|
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.
|
08-15-2012, 01:07 PM
|
#8
|
Moderator
Registered: Aug 2002
Posts: 26,642
|
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.
|
All times are GMT -5. The time now is 01:37 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|