LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 12-29-2014, 07:01 AM   #1
srijivdimri
Member
 
Registered: Jun 2013
Location: India.
Posts: 35

Rep: Reputation: Disabled
Processess set in crontab not working.


Hi Experts, I have cron setup on my server. I am not sure as to why the jobs are not able to run. Below are the jobs, status for the crond and the /var/log/cron messages.

crontab -l
01 * * * * /bin/echo "Hello"

/etc/init.d/crond status
crond (pid 4903) is running...

vim /var/log/cron-20141229
Dec 29 07:23:05 localhost crond[2448]: (CRON) STARTUP (1.4.4)
Dec 29 07:23:06 localhost crond[2448]: (CRON) INFO (running with inotify support)
Dec 29 07:30:01 localhost CROND[2732]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Dec 29 07:40:01 localhost CROND[2751]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Dec 29 07:50:01 localhost CROND[2770]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Dec 29 08:00:01 localhost CROND[2789]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Dec 29 08:01:01 localhost CROND[2793]: (root) CMD (run-parts /etc/cron.hourly)
Dec 29 08:01:01 localhost run-parts(/etc/cron.hourly)[2793]: starting 0anacron
Dec 29 08:01:02 localhost anacron[2804]: Anacron started on 2014-12-29
Dec 29 08:01:02 localhost run-parts(/etc/cron.hourly)[2806]: finished 0anacron
Dec 29 08:01:02 localhost anacron[2804]: Will run job `cron.daily' in 24 min.
Dec 29 08:01:02 localhost anacron[2804]: Jobs will be executed sequentially
Dec 29 08:01:02 localhost run-parts(/etc/cron.hourly)[2793]: starting mcelog.cron
Dec 29 08:01:02 localhost run-parts(/etc/cron.hourly)[2814]: finished mcelog.cron
Dec 29 08:10:01 localhost CROND[2832]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Dec 29 08:20:01 localhost CROND[2852]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Dec 29 08:25:02 localhost anacron[2804]: Job `cron.daily' started
Dec 29 08:25:02 localhost run-parts(/etc/cron.daily)[2861]: starting 00webalizer
Dec 29 08:25:02 localhost run-parts(/etc/cron.daily)[2868]: finished 00webalizer
Dec 29 08:25:02 localhost run-parts(/etc/cron.daily)[2861]: starting certwatch
Dec 29 08:25:02 localhost run-parts(/etc/cron.daily)[2861]: starting 00webalizer
Dec 29 08:25:02 localhost run-parts(/etc/cron.daily)[2868]: finished 00webalizer
Dec 29 08:25:02 localhost run-parts(/etc/cron.daily)[2861]: starting certwatch
Dec 29 08:25:02 localhost run-parts(/etc/cron.daily)[2879]: finished certwatch
Dec 29 08:25:02 localhost run-parts(/etc/cron.daily)[2861]: starting cups
Dec 29 08:25:02 localhost run-parts(/etc/cron.daily)[2886]: finished cups
Dec 29 08:25:02 localhost run-parts(/etc/cron.daily)[2861]: starting logrotate




Appreciate all your help in advance.
 
Old 12-29-2014, 04:28 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Quote:
Originally Posted by srijivdimri View Post
Hi Experts, I have cron setup on my server. I am not sure as to why the jobs are not able to run. Below are the jobs, status for the crond and the /var/log/cron messages.

crontab -l
01 * * * * /bin/echo "Hello"

/etc/init.d/crond status
crond (pid 4903) is running...

vim /var/log/cron-20141229
Dec 29 07:23:05 localhost crond[2448]: (CRON) STARTUP (1.4.4)
Dec 29 07:23:06 localhost crond[2448]: (CRON) INFO (running with inotify support)
Dec 29 07:30:01 localhost CROND[2732]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Dec 29 07:40:01 localhost CROND[2751]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Dec 29 07:50:01 localhost CROND[2770]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Dec 29 08:00:01 localhost CROND[2789]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Dec 29 08:01:01 localhost CROND[2793]: (root) CMD (run-parts /etc/cron.hourly)
Dec 29 08:01:01 localhost run-parts(/etc/cron.hourly)[2793]: starting 0anacron
Dec 29 08:01:02 localhost anacron[2804]: Anacron started on 2014-12-29
Dec 29 08:01:02 localhost run-parts(/etc/cron.hourly)[2806]: finished 0anacron
Dec 29 08:01:02 localhost anacron[2804]: Will run job `cron.daily' in 24 min.
Dec 29 08:01:02 localhost anacron[2804]: Jobs will be executed sequentially
Dec 29 08:01:02 localhost run-parts(/etc/cron.hourly)[2793]: starting mcelog.cron
Dec 29 08:01:02 localhost run-parts(/etc/cron.hourly)[2814]: finished mcelog.cron
Dec 29 08:10:01 localhost CROND[2832]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Dec 29 08:20:01 localhost CROND[2852]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Dec 29 08:25:02 localhost anacron[2804]: Job `cron.daily' started
Dec 29 08:25:02 localhost run-parts(/etc/cron.daily)[2861]: starting 00webalizer
Dec 29 08:25:02 localhost run-parts(/etc/cron.daily)[2868]: finished 00webalizer
Dec 29 08:25:02 localhost run-parts(/etc/cron.daily)[2861]: starting certwatch
Dec 29 08:25:02 localhost run-parts(/etc/cron.daily)[2861]: starting 00webalizer
Dec 29 08:25:02 localhost run-parts(/etc/cron.daily)[2868]: finished 00webalizer
Dec 29 08:25:02 localhost run-parts(/etc/cron.daily)[2861]: starting certwatch
Dec 29 08:25:02 localhost run-parts(/etc/cron.daily)[2879]: finished certwatch
Dec 29 08:25:02 localhost run-parts(/etc/cron.daily)[2861]: starting cups
Dec 29 08:25:02 localhost run-parts(/etc/cron.daily)[2886]: finished cups
Dec 29 08:25:02 localhost run-parts(/etc/cron.daily)[2861]: starting logrotate




Appreciate all your help in advance.
It's not going to show anything since you're not capturing it's output. Try adding a > /tmp/Hello or something. Or put it in a bash script (chmod +x scriptname to make it executable) to run from cron:

Code:
#!/bin/bash

/bin/echo "Hello".`date` > /tmp/Hello
Code:
* * * * * /home/youruser/Hello.sh
And change your minute to * so your not waiting an hour for it to execute while you troubleshoot.
 
3 members found this post helpful.
  


Reply



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
how to set cronjob in /etc/crontab sublime188 Linux - Newbie 3 06-27-2015 09:32 AM
[SOLVED] set crontab from a bash script ac_kumar Linux - Newbie 9 03-25-2012 11:35 AM
working set window(keep track the working set)and page-fault frequency Medici Linux - Kernel 0 07-01-2010 01:38 AM
i want a shell script to print system processess in required format. vpradeep Linux - Newbie 4 07-04-2008 04:35 AM
Program processess still running after I close them in gentoo 1veedo Linux - Software 3 12-21-2005 04:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 12:55 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration