LinuxQuestions.org
Help answer threads with 0 replies.
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 01-31-2011, 04:29 AM   #1
keevill
LQ Newbie
 
Registered: Dec 2009
Posts: 28

Rep: Reputation: 0
How can I get crontab to execute process every 10 minutes?


I am trying to get a process ( SARG access log report tool ) to run every 10 minutes but I cannot get it to work.
Here is the content of the crontab file
______________________________
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# m h dom mon dow user command
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#* 1 * * * root usr/bin/sarg
#@hourly root usr/bin/sarg
*/10 * * * * root usr/bin/sarg

#

______________________

As you can see, I have commented out the "@hourly" command and inserted the /10 command to get it to execute every ten minutes but it still runs hourly.

Using the crontab -l command to list running jobs I get.
_____________________________________
# m h dom mon dow command
1 * * * * /usr/bin/sarg
___________________________
Showing that the process runs hourly, which indeed it does.
I have tried making the changes and restarting cron like this.

_____________________________________
root@ubuntu240110-desktop:~# sudo service cron stop
cron stop/waiting
root@ubuntu240110-desktop:~# sudo service cron start
cron start/running, process 16968
____________________________

Any ideas how to do ?
-keevill-
Using Ubuntu 10.04
 
Old 01-31-2011, 04:49 AM   #2
Perceptor
Member
 
Registered: Jul 2007
Location: the Future
Distribution: Slackware
Posts: 128

Rep: Reputation: 64
*/10 * * * * command
Check out this site too.
Also, I think the reason your entry is not working is a typo, it should be
Code:
*/10 * * * * /usr/bin/sarg

Last edited by Perceptor; 01-31-2011 at 04:53 AM. Reason: spelling
 
Old 01-31-2011, 08:47 PM   #3
keevill
LQ Newbie
 
Registered: Dec 2009
Posts: 28

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Perceptor View Post
*/10 * * * * command
Check out this site too.
Also, I think the reason your entry is not working is a typo, it should be
Code:
*/10 * * * * /usr/bin/sarg
Now it works !! I guess I didn't need the 'root' in front of the command. Neat site too for auto crontab syntax !!
Thx,
-keevill-
 
Old 01-31-2011, 09:06 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
You didn't necessarily have to be root, but you certainly need the / in front of usr/bin ;}

Last edited by Tinkster; 01-31-2011 at 11:40 PM. Reason: grandma, errrh, grammar (missing two words)
 
Old 01-31-2011, 09:56 PM   #5
keevill
LQ Newbie
 
Registered: Dec 2009
Posts: 28

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Tinkster View Post
You didn't necessarily be root, but you certainly need the / in front of usr/bin ;}
ahhh... !! Of course - I should have spotted that.

I too prefer to understand rather than blindly follow turnkey solutions - Many thx once again !
-keevill-
 
  


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
Crontab question (Every few minutes after a certain time) Norwood Linux - Newbie 5 03-08-2010 03:41 PM
How to start crontab every 5 minutes? cola Linux - General 15 12-31-2009 12:00 PM
why won't my crontab execute the commands? dannemil Linux - Newbie 4 02-12-2008 06:25 PM
Crontab every 10 minutes Neorio Linux - General 1 11-19-2003 12:46 AM
problem with binding process and than execute another process chapa Programming 0 08-27-2003 04:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:42 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration