Quote:
Originally Posted by srijivdimri
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.