LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices

Reply
 
Search this Thread
Old 02-06-2009, 03:28 AM   #1
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Mageia Studio-13.37 Kubuntu.
Posts: 3,325
Blog Entries: 33

Rep: Reputation: 199Reputation: 199
Post How do I start a cron job that starts on the 22nd of the month, mrtg.


How do I start a cron job that starts on the 22nd of the month.

The cron job is MRTG Bandwidth monitor.

I have check the /usr/share/docs/mrtg but I have not found anything relating
to when the graph starts.

At the moment it starts promptly at the 1st day of each month. Which is
nice, but it's hard to figure if I have gone over my limit or not, going
over is 25c/Mb

An extra cd's worth can be quite expensive.

So I'm sure this is a cron job, but I can't see the trees for the forest,
could someone point me in the right direction?


Cheers Glenn

/etc/crontab
Code:
#No comment
SHELL=/bin/bash

#No comment
PATH=/sbin:/bin:/usr/sbin:/usr/bin

#No comment
MAILTO=root

#No comment
HOME=/

#run-parts
01 * * * *	root	nice -n 19 run-parts --report /etc/cron.hourly

#No comment
02 4 * * *	root	nice -n 19 run-parts --report /etc/cron.daily

#No comment
22 4 * * 7	root	nice -n 19 run-parts --report /etc/cron.weekly

#No comment
42 4 1 * *	root	nice -n 19 run-parts --report /etc/cron.monthly

#No comment
0-59/10 * * * *	root	/usr/bin/mrtg /etc/mrtg/mrtg.cfg


# File generated by KCron the Thursday 09 October 2008 22:11.
 
Old 02-06-2009, 04:04 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,384

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
well you'd just have an entry of 01 0 22 * * whatever is running on the first is probably dropped into the /etc/cron.monthly directory.
 
Old 02-06-2009, 04:21 AM   #3
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Mageia Studio-13.37 Kubuntu.
Posts: 3,325
Blog Entries: 33

Original Poster
Rep: Reputation: 199Reputation: 199
Thanks for replying, but I just can't fathom it, maybe I need to look at /etc/cron/monthly...

Back in a minute

Glenn
 
Old 02-06-2009, 04:25 AM   #4
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Mageia Studio-13.37 Kubuntu.
Posts: 3,325
Blog Entries: 33

Original Poster
Rep: Reputation: 199Reputation: 199
My /etc/cron.monthly holds 3 files,

0anacron
0sarg
readahead-monthly.cron

none mention mrtg.

ps. It's the forest trees thing, I don't understand it.

I feel stupid...

Last edited by GlennsPref; 02-06-2009 at 04:28 AM. Reason: sometimes I feel stupid
 
Old 02-06-2009, 04:29 AM   #5
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Mageia Studio-13.37 Kubuntu.
Posts: 3,325
Blog Entries: 33

Original Poster
Rep: Reputation: 199Reputation: 199
Can you point me to the man or manual?
 
Old 02-06-2009, 05:05 AM   #6
ArfaSmif
Member
 
Registered: Oct 2008
Location: Brisbane Australia
Distribution: always back to Fedora
Posts: 241

Rep: Reputation: 50
Do a "man 5 crontab" - this will give you the appropriate man page. However all you have to do is the following.

Edit the /etc/crontab file above and comment out the existing "mrtg" line, then insert the following line

1 1 22 * * root /usr/bin/mrtg /etc/mrtg/mrtg.cfg

Save the file. this will start the mrtg job at 1 minute past 1am on the 22nd of each month. You can modify the first two numbers "1 1" to suit yourself. These are the minute and hour numbers respectively.

Hope this helps.
 
Old 02-06-2009, 05:13 AM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,384

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
try this... http://tinyurl.com/9zttkv ;-)
 
Old 02-06-2009, 06:24 AM   #8
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,488

Rep: Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956
Try
Code:
rpm -ql mrtg | grep etc
to find out. Maybe in /etc/cron.d?
 
Old 02-06-2009, 05:59 PM   #9
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Mageia Studio-13.37 Kubuntu.
Posts: 3,325
Blog Entries: 33

Original Poster
Rep: Reputation: 199Reputation: 199
Hi, Thank you all, I am now well armed and educated on those cron lines...

Code:
glenn@GamesBox:~/bin$ rpm -ql mrtg | grep etc
/etc/cron.d/mrtg
/etc/httpd/conf/webapps.d/mrtg.conf
/etc/mrtg
/etc/mrtg/mrtg.cfg
glenn@GamesBox:~/bin$
Sorry for appearing lazy, it's been a long week.

;-)
 
  


Reply

Tags
cron, day, start


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] Scheduling a CRON job to run on the first Sunday of the month New2Linux2 Linux - Software 9 08-05-2013 11:42 AM
Cron Job at the end of every Month? waelaltaqi Linux - Software 6 04-05-2012 11:00 AM
end of month cron job tekmann33 Linux - Newbie 5 12-12-2009 06:40 AM
Cron Job: Start it Only once on specified time jCash Linux - Newbie 2 12-07-2007 07:35 PM
Cron Job to run on 2nd and 4th Friday of each month rust8y Linux - General 1 06-25-2007 09:07 PM


All times are GMT -5. The time now is 09:19 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration