Sponsored Content
Top Forums Shell Programming and Scripting Collecting all lines between two time stamp from the log Post 302960865 by zenkarthi on Friday 20th of November 2015 10:44:19 AM
Old 11-20-2015
Thank you all!

@MadeInGermany - your suggestion is working if the time value is lower to higher but if the time value is higher to lower then the output is completely different .

RudiC , The idea, script to collect the logs for every 45 mins and check the errors automatically.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Inserting Date&Time Stamp In Existing Log File

I am trying to insert a line with a date stamp in a file that is used to monitor activity in one of our directories. By doing this, I want to grep that file each day and go to the last entry for each time a error occurred and pull all errors generated if any exist. If error exists I want that error... (3 Replies)
Discussion started by: shephardfamily
3 Replies

2. Shell Programming and Scripting

Extract info from log file and compute using time date stamp

Looking for a shell script or a simple perl script . I am new to scripting and not very good at it . I have 2 directories . One of them holds a text file with list of files in it and the second one is a daily log which shows the file completion time. I need to co-relate both and make a report. ... (0 Replies)
Discussion started by: breez_drew
0 Replies

3. Shell Programming and Scripting

Remove lines of the same time stamp leaving the highest

Hi guys, I have a log that looks like that below. Columns 2 3 4 5 6 7 is the date/time stamp separated by comma. UUU,02,06,2010,10,00,00,00,0000000000000000,0000000000000000,0000000000001224 UUU,02,06,2010,10,05,00,00,0000000000000000,0000000000000000,0000000000001502... (2 Replies)
Discussion started by: borderblaster
2 Replies

4. Shell Programming and Scripting

Identify log files based on time stamp,zip and then copy..HELP

Hi All, PFB is a requirement. I am new to shell scripting. So plz help. It would be highly appreciated. 1. choose all the log files based on a particular date (files location is '/test/domain')--i.e,we should choose all the files that are modified on 29th November, neither 28th nor 30th 2.... (3 Replies)
Discussion started by: skdas_niladri
3 Replies

5. Shell Programming and Scripting

How to get time duration between two human readable time stamp in Unix?

Here is two time I have: Jul 12 16:02:01 Jul 13 01:02:01 and how can I do a simple match to get difference between two time which is 09:00:00 Thanks in advance. (3 Replies)
Discussion started by: ford99
3 Replies

6. Shell Programming and Scripting

awk : collecting all data between two time frame

Hi Experts , I need your help to collect the complete data between two time frame from the log files, when I try awk it's collecting the data only which is printed with time stamp for example, awk works well from "16:00 to 17:30" but its not collecting <line*> "from 17:30 to 18:00" ... (8 Replies)
Discussion started by: zenkarthi
8 Replies

7. Shell Programming and Scripting

To check time stamp in log file and calculate.

Hi Friends, I have the following logfile. i want to make a script for calculate time by time2 - time1 1600266278|random|1|2014-09-19 02:08:56.024|2014-09-19 02:08:59.398|A|B|ROOM|Num0208559970111101788|1|dog|dos 1600266200|random|4|2014-09-19 02:08:06.572|2014-09-19... (2 Replies)
Discussion started by: ooilinlove
2 Replies

8. Shell Programming and Scripting

Collecting logs between two time stamps

Hi, please help me to collect the entire log files between two time stamp. for example, I am looking script to collect the entire log between "2015-03-27 15:59" to "2015-03-27 16:15" in the below sample log file. OS : RHEL 6.3 Date/Time : 24 hours format, the time is printing each log... (12 Replies)
Discussion started by: jerryknj
12 Replies

9. Shell Programming and Scripting

Need Time Stamp Range On Log Files

I have created this script #!/bin/sh FILES=/data/log/access_*.log for f in $FILES do echo "Processing $f file" cat $f | awk '{print $1}' | sort | uniq -c | sort -n | tail done It produces this output Processing /data/log/access_abc.log file 114 1.1.1.1 167 2.2.2.2 ... (38 Replies)
Discussion started by: sharingsunshine
38 Replies

10. Shell Programming and Scripting

Shell Script | Parse log file after a given date and time stamp

I am developing one script which will take log file name, output file name, date, hour and minute as an argument and based on these inputs, the script will scan and capture all the error(s) that have been triggered from a given time. Example: script should capture all the error after 13:50 on Jan... (2 Replies)
Discussion started by: ROMA3
2 Replies
sched_setscheduler(3)					     Library Functions Manual					     sched_setscheduler(3)

NAME
sched_setscheduler - Sets the scheduling policy and scheduling parameters of the specified process (P1003.1b) LIBRARY
Realtime Library (librt.so, librt.a) SYNOPSIS
#include <sched.h> int sched_setscheduler ( pid_t pid, int policy, const struct sched_param *param); PARAMETERS
pid Specifies the ID of the process for which scheduling policy and priority is to be set. If pid is zero, the scheduling policy and priority is set for the calling process. policy Specifies the scheduling policy to be set (SCHED_FIFO, SCHED_RR, or SCHED_OTHER). *param Specifies a pointer to a sched_param structure, which contains the scheduling parameters of the specified process. Currently, the sched_param structure contains only a priority field. The value of priority in the param structure indicates the priority level. DESCRIPTION
The sched_setscheduler function changes the scheduling policy and priority of a process. Changing the scheduling policy and priority ensures that an application can determine more effectively when a process will run. At run time, a process starts out with an initial priority of SCHED_PRIO_USER_MAX. A call to either the sched_setparam or sched_setsched- uler function can raise or lower the priority of a process. If you raise the priority higher than the initial priority, the new priority becomes the maximum for the process. This higher maximum priority exists for the life of the process or until the priority is set to a new, higher priority through another call to the sched_setparam function. The maximum priority cannot be adjusted downward, but subsequent calls to the sched_setparam or sched_setscheduler functions can specify that a process run at a lower priority. Three scheduling policies are supported: two fixed-priority scheduling policies (SCHED_FIFO and SCHED_RR) and one timesharing policy (SCHED_OTHER). Under a fixed-priority scheduling policy, only the user sets and adjusts process priorities. Under a timesharing scheduling policy, the scheduler automatically adjusts priorities according to system resource usage and other factors. The scheduling policies supported by the realtime interface are as follows: SCHED_FIFO Specifies a fixed-priority, first in-first out (FIFO) scheduling policy. Processes waiting at a specific priority level are selected from a process list that is ordered by the amount of time the processes have been on the process list without being executed. Generally, the process at the head of the list has waited the longest time; the process at the tail of the list has waited the shortest time. SCHED_RR Secifies a fixed-priority, round-robin (RR) scheduling policy. Processes waiting at a specific priority level are scheduled in much the same way as for SCHED_FIFO, scheduling with the additional condition that the length of time that a process executes is subject to a quantum. SCHED_OTHER Specifies the standard timesharing scheduling policy. Processes are scheduled in much the same way as for the SCHED_FIFO scheduling policy with the additional condition that the scheduler adjusts process priorities. Recalculation of process pri- orities results in preemption. Setting priorities in conjunction with a FIFO scheduling policy allows a critical process to run as soon as it is ready, for as long as it needs to run, because it will preempt other, lower-priority processes. This behavior is important in situations where scheduling a process must be as fast and as precise as possible. Use the sched_get_priority_max and sched_get_priority_min functions to determine the maximum and minimum values allowed for each scheduling policy. The value of the priority field in the sched_param structure pointed to by param can be any integer within the inclusive range for the current scheduling policy, as defined in <sched.h>. Higher numerical values for param represent higher priorities. The scheduling policy of a process is inherited across fork and exec calls. An application designed for portability must initialize all fields of the sched_param structure before making the function call. You must have superuser privileges to call the sched_setscheduler function. RETURN VALUES
On a successful call to sched_setscheduler, the former scheduling policy of the process is returned. On an unsuccessful call, a value of -1 is returned and errno is set to indicate that an error occurred and that the scheduling policy and parameters of the specified process are unchanged. ERRORS
The sched_setscheduler function fails under the following conditions: [EINVAL] An invalid value is specified for the policy argument or the param pointer is NULL. [EPERM] The requesting process does not have permission to set either the priority or the scheduling policy of the specified process. [ESRCH] No process can be found corresponding to that specified by pid. RELATED INFORMATION
getpid(2), sched_getparam(3), sched_getscheduler(3), sched_setparam(3) Guide to Realtime Programming delim off sched_setscheduler(3)
All times are GMT -4. The time now is 05:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy