Sponsored Content
Full Discussion: Cronjob setting
Operating Systems Linux Red Hat Cronjob setting Post 302610937 by hedkandi on Thursday 22nd of March 2012 03:54:59 AM
Old 03-22-2012
Hi methyl, ygemici

Im trying to get memory reading with the ps command every 5 minutes, 24 hours a day unless the system is down (its set up with S'pore time zone). Since the previous 2 cron settings didn't work, so I edited the cron to run 5 mins and all other paramaters set as * :

Code:
[root@EP-WCRM1 03]# ls -lrt
total 572
-rw-r--r--. 1 root root 206521 Mar 19 23:55 2012-03-19
-rw-r--r--. 1 root root 186589 Mar 20 12:15 2012-03-20
-rw-r--r--. 1 root root  82800 Mar 21 23:55 2012-03-21--------working!
-rw-r--r--. 1 root root  85050 Mar 22 15:40 2012-03-22

and this is how my cronjob looks like now:

Code:
##Run memory report every 5 mins daily
*/5 * * * * /usr/local/bin/MEM_Report/MEM_daily_run

Also, there's another script that creates an empty report file every day at 1min past midnight:

Code:
##Create daily memory log
01 00 * * * /usr/local/bin/MEM_Report/MEM_day_log

This is the expected result, which is like totally working now!
Code:
[root@EP-WCRM1 03]# more 2012-03-22
  PID USER         TIME COMMAND         %MEM
20110 root     00:00:19 scanner          3.1
 6320 root     00:08:05 nailslogd        0.7
28559 root     00:01:25 httpd            0.5
 6491 root     00:00:05 logepo           0.5
 6416 root     00:21:45 kdm_greet        0.4
25053 root     00:00:30 plasma-desktop   0.4
24783 root     00:00:05 Xvnc             0.3
25027 root     01:43:34 knotify4         0.3
25017 root     00:00:06 kded4            0.2
  PID USER         TIME COMMAND         %MEM

THANK YOU ALL!! Smilie

Last edited by hedkandi; 03-22-2012 at 05:01 AM.. Reason: correction
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Cronjob

Please can someone help me. I need to set up a cron job to measure CPU usage, Disk I/O and memory usage over a period of 1 minute along with the number of users logged into the system. I also need to send it to another user besides myself every hour. Please can someone help me! Thanks. (4 Replies)
Discussion started by: gerwhelan
4 Replies

2. Solaris

at vs cronjob

HI, What is the differnece between at / con job? thanks in advance. (1 Reply)
Discussion started by: mokkan
1 Replies

3. Shell Programming and Scripting

Cronjob

Hi, I'm totally new to shell scripting. I need help in my crontab script. I'm trying to read some values from user (username, log file directory, server) and then use those value to create a crontab for log rotation after some interval of time. creating crontabs manually isn't big deal.... (11 Replies)
Discussion started by: MisterKhan
11 Replies

4. Fedora

Setting up Cronjob

Hi, I had to setup some cron jobs using crontab -e when logged in as root. I noticed that the jobs only run when the permissons on the shell script file are set to execute on root and other. Why does "other" have to have its execution permission set? (6 Replies)
Discussion started by: mojoman
6 Replies

5. UNIX for Dummies Questions & Answers

how to cancel a cronjob if the cronjob still running

hi everyone I'm newbie in this forum hope I can get some help here :) I have a command in crontab that executed every 1 minute sometime this command need more than 1 minute to finish the problem is, the crontab execute this command although it's not finish processing yet and causing the system... (7 Replies)
Discussion started by: 2j4h
7 Replies

6. UNIX for Dummies Questions & Answers

Cronjob help

Hi I am very new to linux. I want to run a cronjob every 15 minutes that checks a directory for files. If the directory contains more than ten files I want it to send an email to me. All I have is this... */15 * * * * ls -l | wc -l | | mail -s "This is just a test" I would... (2 Replies)
Discussion started by: LinuxNewb
2 Replies

7. UNIX for Dummies Questions & Answers

cronjob

Is the cronjob below can run only first wednesday of every month? 30 5 1-7 * 3 command please tell me (3 Replies)
Discussion started by: Anjan1
3 Replies

8. UNIX for Advanced & Expert Users

Help with cronjob setting

Hi everyone, I have set a cronjob to run every 5 minutes. But this has to be stopped between 1:00AM to 3:00AM. How do I do it? (3 Replies)
Discussion started by: VidyaVenugopal
3 Replies

9. Solaris

Is there a difference between setting a user as nologin and setting it as a role?

Trying to figure out the best method of security for oracle user accounts. In Solaris 10 they are set as regular users but have nologin set forcing the dev's to login as themselves and then su to the oracle users. In Solaris11 we have the option of making it a role because RBAC is enabled but... (1 Reply)
Discussion started by: os2mac
1 Replies

10. UNIX for Beginners Questions & Answers

Cronjob

How to set cronjob for 48 hours. I can set for 2 days as shown below. * * */2 * * It is creating confusion for 30 days & 31 days per month. (3 Replies)
Discussion started by: Nishit
3 Replies
TIME_FIELDS_FROM_FILETIME(3)				       http://www.synce.org/				      TIME_FIELDS_FROM_FILETIME(3)

NAME
time_fields_from_filetime - convert between FILETIME and TIME_FIELDS SYNOPSIS
#include <synce.h> void time_fields_from_filetime(const FILETIME *filetime, TIME_FIELDS *timeFields); bool time_fields_to_filetime(const TIME_FIELDS *timeFields, const FILETIME *filetime); DESCRIPTION
The time_fields_from_filetime() function converts a FILETIME value into the existing broken down TIME_FIELDS struct pointed to by time- Fields. time_fields_to_filetime() does the reverse. typedef struct _TIME_FIELDS { CSHORT Year; /* Specifies a value from 1601 on. */ CSHORT Month; /* Specifies a value from 1 to 12. */ CSHORT Day; /* Specifies a value from 1 to 31. */ CSHORT Hour; /* Specifies a value from 0 to 23. */ CSHORT Minute; /* Specifies a value from 0 to 59. */ CSHORT Second; /* Specifies a value from 0 to 59. */ CSHORT Milliseconds; /* Specifies a value from 0 to 999. */ CSHORT Weekday; /* Specifies a value from 0 to 6 (Sunday to Saturday). */ } TIME_FIELDS; RETURN VALUE
The time_fields_to_filetime() function returns FALSE on encountering an invalid value, or TRUE if successful. SEE ALSO
synce(7) The SynCE Project 2007-08-26 TIME_FIELDS_FROM_FILETIME(3)
All times are GMT -4. The time now is 12:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy