Hello, kind forum.
My os is:
Code:
[root@livestreet var]# uname -a
Linux livestreet 2.6.32-279.14.1.el6.x86_64 #1 SMP Tue Nov 6 23:43:09 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
Code:
[root@livestreet var]# cat /etc/redhat-release
CentOS release 6.3 (Final)
And I can't get root cron to work.
After reading
this doc ,I have added line to /etc/crontab:
cat /etc/crontab
Code:
# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed
0-59/1 * * * * root ls /proc >> /tmp/proc
After that i have tried to restart crond, and reboot computer, but nothing happens.
Code:
[root@livestreet log]# tail /var/log/cron
Dec 9 20:01:01 livestreet CROND[4122]: (root) CMD (run-parts /etc/cron.hourly)
Dec 9 20:01:01 livestreet run-parts(/etc/cron.hourly)[4122]: starting 0anacron
Dec 9 20:01:01 livestreet run-parts(/etc/cron.hourly)[4131]: finished 0anacron
Dec 9 20:55:01 livestreet crond[3236]: (*system*) RELOAD (/etc/crontab)
Dec 9 21:01:01 livestreet CROND[4160]: (root) CMD (run-parts /etc/cron.hourly)
Dec 9 21:01:01 livestreet run-parts(/etc/cron.hourly)[4160]: starting 0anacron
Dec 9 21:01:01 livestreet run-parts(/etc/cron.hourly)[4169]: finished 0anacron
Dec 9 21:22:52 livestreet crond[4197]: (CRON) STARTUP (1.4.4)
Dec 9 21:22:52 livestreet crond[4197]: (CRON) INFO (running with inotify support)
Dec 9 21:22:52 livestreet crond[4197]: (CRON) INFO (@reboot jobs will be run at computer's startup.)
Code:
[root@livestreet log]# tail /var/log/messages
Dec 9 03:13:02 livestreet rsyslogd: [origin software="rsyslogd" swVersion="5.8.10" x-pid="1078" x-info="http://www.rsyslog.com"] rsyslogd was HUPed
And there is no file /tmp/proc
In my /etc/anacrontab there is no cron.hourly task like
in this thread. Is that correct?
Code:
[root@livestreet etc]# cat /etc/anacrontab
# /etc/anacrontab: configuration file for anacron
# See anacron(8) and anacrontab(5) for details.
SHELL=/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
# the maximal random delay added to the base delay of the jobs
RANDOM_DELAY=45
# the jobs will be started during the following hours only
START_HOURS_RANGE=3-22
#period in days delay in minutes job-identifier command
1 5 cron.daily nice run-parts /etc/cron.daily
7 25 cron.weekly nice run-parts /etc/cron.weekly
@monthly 45 cron.monthly nice run-parts /etc/cron.monthly
Is /etc/crontab a right place for editing root cron jobs?