Sponsored Content
Top Forums UNIX for Advanced & Expert Users Shell script to append a time for the existing error log file Post 302125599 by gsprasanna on Friday 6th of July 2007 02:32:10 AM
Old 07-06-2007
i had written a script ,

tail -f /filers/f08-perf01/logFiles/wcluster/websites01-perf-1-8901/NodeManagerLogs/cobaltgroup_websites01-perf-1-8901/websites01-perf-1-8901_error.log |grep -v nursery > /home/readonly/g2
date "+%H:%M:%S" >> /home/readonly/g2
cat /home/readonly/g2


or
cd /filers/f08-perf01/logFiles/wcluster/websites01-perf-1-8901/NodeManagerLogs/cobaltgroup_websites01-perf-1-8901/
v1=`tail -f websites01-perf-1-8901_error.log|grep -ivn 'nursery'`
v2=`date "+%H:%M:%S"`
echo $v1 $v2


given executable permission to the file also, but still unable to print the output as
[INFO ][memory ] 4642.754-4644.124: GC 2969600K->745408K (2969600K), 1369.515 ms 23:19:32 2007
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

script to run shell command and insert results to existing xml file

Hi. Thanks for any help with this. I'm not new to programming but I am new to shell programming. I need a script that will 1. execute 'df -k' and return the volume names with specific text 2. surround each line of the above results in opening and closing xml tags 3. insert the results of step... (5 Replies)
Discussion started by: littlejon
5 Replies

2. 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

3. Shell Programming and Scripting

shell script not getting current error messages with time from alert.log

Hi All, I need to get current error messages with time from alert.log.Below is my shell script but it's not working to meet this objective. could anyone pls share on the above issue for resolution: #################################################################### ## ckalertlog.sh ##... (2 Replies)
Discussion started by: a1_win
2 Replies

4. Shell Programming and Scripting

shell script to read a line in gps receiver log file and append that line to new file

Hi, I have gps receiver log..its giving readings .like below Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. GPSD,R=1 $GPGSV,3,1,11,08,16,328,40,11,36,127,00,28,33,283,39,20,11,165,00*71... (3 Replies)
Discussion started by: gudivada213
3 Replies

5. Shell Programming and Scripting

append existing file with zeroes bsed on position

Hi i am trying to append value with 0 to an existing file in the position 50-56 & 58-64 only where empty space is there Rule: 1 row already has some value and i do not want to change anything for this row. 2nd record below you see the position 50-64 is empty, i want to replace with 0000000... (3 Replies)
Discussion started by: kshuser
3 Replies

6. Shell Programming and Scripting

How to append value at first line of CSV file using shell script?

I have an issue where I need to append a value at the last of the csv, I have created a shell script and it is appending the columns at the last but it is appending at all lines, and my requirement is specific to just append at the 1st line. Have a look and suggest, (7 Replies)
Discussion started by: anujrichhariya
7 Replies

7. Shell Programming and Scripting

Append files to a existing tar file.

Hi all, I want to check whether tar file exists in the directory or not. If tar file exists in the directory then I want to append the files to it. I am using the below command to tar files if the file does not exist. tar zcvf <tar file name> <Files to append> However, if want to... (4 Replies)
Discussion started by: Nagaraja Akkiva
4 Replies

8. 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

9. Shell Programming and Scripting

Append date to sql*plus spool (log) file in shell script

SQL*Plus version : 11.2.0.4 OS : Oracle Linux 6.5 SQL*Plus is a client application to connect to oracle database. The log file for this tool is generated via spool command as shown below. I am trying to append date ( $dateString ) to spool file as shown below. $ cat test2.sh #!/bin/bash... (4 Replies)
Discussion started by: kraljic
4 Replies

10. Shell Programming and Scripting

Need shell script to append double quotes for each column in a file

Hi Experts, I am beginner to the shell scripting, My requirement is to append double quotes for each column in a file if double quotes does not exist. Example: "abc"|123|"gh-ch"|23.067 Use code tags, thanks. (10 Replies)
Discussion started by: spidy
10 Replies
PERF_3.2-RECORD(1)						    perf Manual 						PERF_3.2-RECORD(1)

NAME
perf-record - Run a command and record its profile into perf.data SYNOPSIS
perf record [-e <EVENT> | --event=EVENT] [-l] [-a] <command> perf record [-e <EVENT> | --event=EVENT] [-l] [-a] -- <command> [<options>] DESCRIPTION
This command runs a command and gathers a performance counter profile from it, into perf.data - without displaying anything. This file can then be inspected later on, using perf report. OPTIONS
<command>... Any command you can specify in a shell. -e, --event= Select the PMU event. Selection can be: o a symbolic event name (use perf list to list all events) o a raw PMU event (eventsel+umask) in the form of rNNN where NNN is a hexadecimal event descriptor. o a hardware breakpoint event in the form of mem:addr[:access] where addr is the address in memory you want to break in. Access is the memory access type (read, write, execute) it can be passed as follows: mem:addr[:[r][w][x]]. If you want to profile read-write accesses in 0x1000, just set mem:0x1000:rw. --filter=<filter> Event filter. -a, --all-cpus System-wide collection from all CPUs. -l Scale counter values. -p, --pid= Record events on existing process ID. -t, --tid= Record events on existing thread ID. -r, --realtime= Collect data with this RT SCHED_FIFO priority. -D, --no-delay Collect data without buffering. -A, --append Append to the output file to do incremental profiling. -f, --force Overwrite existing data file. (deprecated) -c, --count= Event period to sample. -o, --output= Output file name. -i, --no-inherit Child tasks do not inherit counters. -F, --freq= Profile at this frequency. -m, --mmap-pages= Number of mmap data pages. -g, --call-graph Do call-graph (stack chain/backtrace) recording. -q, --quiet Don't print any message, useful for scripting. -v, --verbose Be more verbose (show counter open errors, etc). -s, --stat Per thread counts. -d, --data Sample addresses. -T, --timestamp Sample timestamps. Use it with perf report -D to see the timestamps, for instance. -n, --no-samples Don't sample. -R, --raw-samples Collect raw sample records from all opened counters (default for tracepoint counters). -C, --cpu Collect samples only on the list of CPUs provided. Multiple CPUs can be provided as a comma-separated list with no space: 0,1. Ranges of CPUs are specified with -: 0-2. In per-thread mode with inheritance mode on (default), samples are captured only when the thread executes on the designated CPUs. Default is to monitor all CPUs. -N, --no-buildid-cache Do not update the builid cache. This saves some overhead in situations where the information in the perf.data file (which includes buildids) is sufficient. -G name,..., --cgroup name,... monitor only in the container (cgroup) called "name". This option is available only in per-cpu mode. The cgroup filesystem must be mounted. All threads belonging to container "name" are monitored when they run on the monitored CPUs. Multiple cgroups can be provided. Each cgroup is applied to the corresponding event, i.e., first cgroup to first event, second cgroup to second event and so on. It is possible to provide an empty cgroup (monitor all the time) using, e.g., -G foo,,bar. Cgroups must have corresponding events, i.e., they always refer to events defined earlier on the command line. SEE ALSO
perf_3.2-stat(1), perf_3.2-list(1) perf 06/24/2012 PERF_3.2-RECORD(1)
All times are GMT -4. The time now is 08:15 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy