LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 08-18-2014, 07:03 AM   #1
ankitb123
LQ Newbie
 
Registered: Aug 2010
Posts: 3

Rep: Reputation: 0
Unhappy Cronjob problem


Hello,

I am facing problem to regarding cronjob, On last week i have set the cronjob for dated 11th August, 2014 at 11:57 AM.

57 11 11 8 1 /bin/croncheck sh /root/test.sh

Above cronjob ran successfully but it was ran today also on 11:57 AM.

You can check the cron log.

Aug 18 11:57:01 RnD_server CROND[17044]: (root) CMD (/bin/croncheck sh /root/test.sh)

Please help !!!
 
Old 08-18-2014, 07:18 AM   #2
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 981
Blog Entries: 2

Rep: Reputation: 235Reputation: 235Reputation: 235
man 5 crontab says

Note: The day of a command's execution can be specified by two fields -- day of month, and day of week. If both
fields are restricted (ie, aren't *), the command will be run when either field matches the current time. For
example,
"30 4 1,15 * 5" would cause a command to be run at 4:30 am on the 1st and 15th of each month, plus every Friday.
 
1 members found this post helpful.
Old 08-18-2014, 07:33 AM   #3
ankitb123
LQ Newbie
 
Registered: Aug 2010
Posts: 3

Original Poster
Rep: Reputation: 0
Lightbulb crontab issue

Thanks for reply,

According to your cron, if i want to run only on 1st and 15th of each month (not on every friday), then cron should be set as by:

"30 4 1,15 * *" command.sh

Is it true ?

Quote:
Originally Posted by linosaurusroot View Post
man 5 crontab says

Note: The day of a command's execution can be specified by two fields -- day of month, and day of week. If both
fields are restricted (ie, aren't *), the command will be run when either field matches the current time. For
example,
"30 4 1,15 * 5" would cause a command to be run at 4:30 am on the 1st and 15th of each month, plus every Friday.
 
Old 08-18-2014, 10:21 AM   #4
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 981
Blog Entries: 2

Rep: Reputation: 235Reputation: 235Reputation: 235
Quote:
Originally Posted by ankitb123 View Post
if i want to run only on 1st and 15th of each month (not on every friday), then cron should be set as by:

"30 4 1,15 * *" command.sh
yes but without the quotes and I would use a pathname on command.sh
 
1 members found this post helpful.
Old 08-18-2014, 06:39 PM   #5
mikeneedshelp
LQ Newbie
 
Registered: Aug 2014
Posts: 12

Rep: Reputation: Disabled
Also, if you want to set the job to run at a more specific time....use the "at" command.
 
1 members found this post helpful.
Old 08-19-2014, 12:38 AM   #6
ankitb123
LQ Newbie
 
Registered: Aug 2010
Posts: 3

Original Poster
Rep: Reputation: 0
Cool

Thanks linosaurus,

Thank u so much for your help, you can close this post.

Quote:
Originally Posted by linosaurusroot View Post
yes but without the quotes and I would use a pathname on command.sh
 
  


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
[SOLVED] Problem with cronjob for munin tpm Linux - Server 4 12-06-2011 10:50 AM
cronjob problem manoj.linux Linux - Enterprise 7 03-17-2008 12:52 PM
Problem with cronjob Arndt Linux - Newbie 1 04-05-2005 06:40 AM
cronjob problem chadi Linux - General 5 10-10-2004 10:09 PM
cronjob problem ashley75 Linux - General 2 05-28-2004 06:47 PM


All times are GMT -5. The time now is 04:59 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