LinuxQuestions.org
Visit Jeremy's Blog.
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 06-11-2009, 12:16 AM   #1
ravibhure
Member
 
Registered: May 2007
Posts: 75

Rep: Reputation: 15
Error - Why cron job running every 1 min


cron for every 3 hours but when check with cron log it shows it runs after every 1 min
Please any one help why it runs on every min when it only run on given time.

[root@appser ~]# crontab -u prod -l
* */3 * * * /backup/backup.sh

[root@appser ~]# tail /var/log/cron
Jun 10 21:11:01 appser crond[18064]: (prod) CMD (/backup/backup.sh)
Jun 10 21:12:01 appser crond[18072]: (prod) CMD (/backup/backup.sh)
Jun 10 21:13:01 appser crond[18107]: (prod) CMD (/backup/backup.sh)
Jun 10 21:14:01 appser crond[18161]: (prod) CMD (/backup/backup.sh)
Jun 10 21:15:01 appser crond[18178]: (prod) CMD (/backup/backup.sh)
Jun 10 21:16:01 appser crond[18221]: (prod) CMD (/backup/backup.sh)
Jun 10 21:17:01 appser crond[18249]: (prod) CMD (/backup/backup.sh)
Jun 10 21:17:58 appser crontab[18294]: (root) LIST (prod)
Jun 10 21:18:01 appser crond[18296]: (prod) CMD (/backup/backup.sh)
Jun 10 21:19:01 appser crond[18335]: (prod) CMD (/backup/backup.sh)
 
Old 06-11-2009, 12:20 AM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Give it a minute for the relevant hour. Something like
Code:
10 */3 * * * /backup/backup.sh
 
Old 06-11-2009, 12:34 AM   #3
ravibhure
Member
 
Registered: May 2007
Posts: 75

Original Poster
Rep: Reputation: 15
Hello billy,
Thanks for your reply, but we have already test this and again checked that it runs every min, and then changed cron enrtry like this
* 0,3,6,9,12,15,18,21 * * * /bin/sh /backup/backup.sh >/dev/null 2>&1

but not get any reason why it runs every min.
Also I have checked with google and few linux forum's but not getting any satisfied answer's from them.

Can you give any reason why it's happen
Please help me to resolve this

Thanks
 
Old 06-11-2009, 12:39 AM   #4
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Which crontab are you editing and how?
 
Old 06-11-2009, 12:40 AM   #5
ravibhure
Member
 
Registered: May 2007
Posts: 75

Original Poster
Rep: Reputation: 15
Hello billy,

[root@appser ~]# rpm -qf /usr/bin/crontab
vixie-cron-4.1-72.el5

and OS version is
[root@appser ~]# cat /etc/issue
CentOS release 5.2 (Final)
Kernel \r on an \m
 
Old 06-11-2009, 12:44 AM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Your new entry still says every minute (*) for every 3rd hour. You must specify a specific minute value, not a wildcard.

See http://www.adminschoice.com/docs/cro...Crontab%20file
 
Old 06-11-2009, 06:24 AM   #7
ravibhure
Member
 
Registered: May 2007
Posts: 75

Original Poster
Rep: Reputation: 15
Thanks chrism01,
Now we have resolved this

Thanks
 
Old 06-11-2009, 07:28 AM   #8
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
How did you resolve it?
 
  


Reply


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
cron job running PHP script to update MySQL - access denied error Beauford2008 Linux - Newbie 9 09-24-2008 08:17 PM
NTP cron job runs every 5 min instead of hour OlRoy Linux - Networking 17 02-28-2008 11:51 AM
cron job not running vincebs Linux - Software 34 10-30-2004 02:27 PM
Cron job not running? james_cwy Linux - Newbie 6 12-14-2003 09:24 PM
Cron Job Not Running pzorn Linux - General 4 10-02-2003 02:38 PM


All times are GMT -5. The time now is 10:29 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration