LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-19-2003, 07:23 PM   #1
pilipk01
LQ Newbie
 
Registered: Sep 2003
Location: new zealand
Posts: 8

Rep: Reputation: 0
Question crontab entry


hey all,

How can I specify the crontab entry or entries which will append the contents of /proc/loadavg to the file /var/log/loads. This is to be done between the hours of 6am to 6pm at 5 minute intervals, Monday to Friday. On Monday to Friday, after hours, it should run every 15 minutes. On the weekend, all hours, it should be run every 30 minutes.

thanx in advance
 
Old 11-19-2003, 07:28 PM   #2
Sometimes
Member
 
Registered: Oct 2003
Location: Richmond, VA
Distribution: Depends on the week...
Posts: 64

Rep: Reputation: 15
Simple enough.


cat /proc/loadavg >> /var/log/loads


>> will append to a file.

You could do something like:

date >> /var/log/loads && cat /proc/loadavg >> /var/log/loads


That will first append the current time/date, and then append the loadavg file.

(Make sure you don't use just > because that will overwrite the file and create a new one)

Making the crontab entries themselves should be fairly easy from that point out. The are MANY excellent tutorials on using cron on the web.
 
Old 11-19-2003, 07:39 PM   #3
pilipk01
LQ Newbie
 
Registered: Sep 2003
Location: new zealand
Posts: 8

Original Poster
Rep: Reputation: 0
Re: crontab entry

Quote:
Originally posted by pilipk01
hey all,

This is to be done between the hours of 6am to 6pm at 5 minute intervals, Monday to Friday. On Monday to Friday, after hours, it should run every 15 minutes. On the weekend, all hours, it should be run every 30 minutes.

how do i go about it?

cheers
 
Old 11-19-2003, 07:47 PM   #4
Sometimes
Member
 
Registered: Oct 2003
Location: Richmond, VA
Distribution: Depends on the week...
Posts: 64

Rep: Reputation: 15
http://weather.ou.edu/~billston/crontab/


That is an excellent tutorial on learning how to use crontab. It explains everything you need to know to get everything up and running the way you want it to.

Not trying to be rude by just sending you a link, but there is no need to reinvent the wheel if someone else has already written something comprehensive on the subject. If you don't like his tutorial, try doing a google for "crontab tutorial". I just did, and dozens upon dozens came up.
 
Old 11-19-2003, 07:53 PM   #5
pilipk01
LQ Newbie
 
Registered: Sep 2003
Location: new zealand
Posts: 8

Original Poster
Rep: Reputation: 0
thx man
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
crontab entry? Master Fox Linux - Software 4 08-23-2005 01:20 PM
crontab job entry notolerance Linux - Software 2 02-20-2005 02:40 PM
cronjob entry in crontab rockwell_001 Linux - General 2 06-30-2004 02:59 PM
making an entry in crontab through code (perl) akaash Programming 2 05-17-2004 03:36 AM
hosts entry for a lan unit with no dns entry linxtc Linux - Networking 1 10-03-2003 08:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:52 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
Open Source Consulting | Domain Registration