I am writing a bash script to capture the last 30 minutes's contents from log file to a new file. This job is a scheduled job and will run every 30 minutes. The log file is db2diag.log in DB2. I am having difficulties copying the last 30 minutes's contents. Can someone please help me. Thanks
The sample log file is like
Last edited by Scrutinizer; 10-22-2019 at 01:13 PM..
Reason: code tags
I want to capture contents of a file between 2 strings into another file
for eg all lines in between the keywords "start log" and "end log" should be copied into another file (4 Replies)
Could someone show me how to copy the contents of a file to the clipboard automatically without manually selecting its contents? I just want to press the "Paste Key" to show the results. I wish to use this in a ksh script.
I'm using Solaris.
Thanks! (5 Replies)
Hi all
I need to copy the entire contents of one file into an existing file at a specific location. I know the exact line number where I need to put it. It appears I would use either sed or awk to do this, but I have been unsuccessful so far:
File A
line 1
line 2
line 3
line 4
... (6 Replies)
I'm looking to write a script that will check the contents of a directory, and if any files exist in that directory copy them to a temporary folder. The target files are only resident for a few seconds, so I think the script needs to be running constantly.
Any pointers would be really... (3 Replies)
Hi All,
I want to edit my gate level netlists by searching for the content between two patterns
eg:
ff1 \test/a0 ( .CLK(\test/ClkInt0_acb_00x1 ),.D(\test/Rakicc ), .QB(\test/X ), .VDD(1'b1), .VSS(1'b0));
ff1 \test/a1 ( .CLK(\test/medis0_acb_00x1 ),.D(\test/hedwc ), .QB(\test/X ),... (6 Replies)
Hi,
I am trying to figure out how to copy the contents of a file to the clipboard, then paste into a command. i.e copy contents of file /path/filename.txt to <command> <paste text>
Hope that makes sense. Basically tryting to copy the text for use in a command without having to open the... (8 Replies)
Hi,
I am stuck up with a problem of copying the contents of a directory where one of the folder name is changed daily.
Problem:
I have the folder structure as:
RefWorlds2/LINGCC4_X64/odsdev/odessy/UTI/621GA_build_xxx/.../..
In the above path the build number (xxx) will be changed... (3 Replies)
Hi
i need Script to copy the contents of two files into one file
i have 2 fil X1.txt / X2.txt i need script to copy the contents of X1 and X2 In AllXfile
X1.txt
File X1
X2.txt
File X2
AllXfile.txt
File X1
File X2 (2 Replies)
I need to write a script (in bash) that copies the content of the first file in each folder of a directory to the second file in the same folder. I tried this and it didn't work - it just came back with errors and I'm not sure how to fix it. Help is very much appreciated!
for mpdir in... (4 Replies)
Hi all,
System Ubuntu 16.04.3 LTS
i have the following log
INFO 2019-02-07 15:13:31,099 module.py:700] default: "POST /join/8550614e-3e94-4fa5-9ab2-135eefa69c1b HTTP/1.0" 500 2042
INFO 2019-02-07 15:13:31,569 module.py:700] default: "POST /join/6cb9c452-dcb1-45f3-bcca-e33f5d450105... (15 Replies)
Discussion started by: charli1
15 Replies
LEARN ABOUT DEBIAN
log::loglite
LogLite(3pm) User Contributed Perl Documentation LogLite(3pm)NAME
Log::LogLite - The "Log::LogLite" class helps us create simple logs for our application.
SYNOPSIS
use Log::LogLite;
my $LOG_DIRECTORY = "/where/ever/our/log/file/should/be";
my $ERROR_LOG_LEVEL = 6;
# create new Log::LogLite object
my $log = new Log::LogLite($LOG_DIRECTORY."/error.log", $ERROR_LOG_LEVEL);
...
# we had an error
$log->write("Could not open the file ".$file_name.": $!", 4);
DESCRIPTION
In order to have a log we have first to create a "Log::LogLite" object. The c<Log::LogLite> object is created with a logging level. The
default logging level is 5. After the "Log::LogLite" object is created, each call to the "write" method may write a new line in the log
file. If the level of the message is lower or equal to the logging level, the message will be written to the log file. The format of the
logging messages can be controled by changing the template, and by defining a default message. The class uses the IO::LockedFile class.
CONSTRUCTOR
new ( FILEPATH [,LEVEL [,DEFAULT_MESSAGE ]] )
The constructor. FILEPATH is the path of the log file. LEVEL is the defined logging level - the LEVEL data member. DEFAULT_MESSAGE will
define the DEFAULT_MESSAGE data member - a message that will be added to the message of each entry in the log (according to the
TEMPLATE data member, see below).
The levels can be any levels that the user chooses to use. There are, though, recommended levels:
0 the application is unusable
1 the application is going to be unusable
2 critical conditions
3 error conditions
4 warning conditions
5 normal but significant condition
6 informational
7+ debug-level messages
The default value of LEVEL is 5. The default value of DEFAULT_MESSAGE is "". Returns the new object.
METHODS
write( MESSAGE [, LEVEL ] )
If LEVEL is less or equal to the LEVEL data member, or if LEVEL is undefined, the string in MESSAGE will be written to the log file.
Does not return anything.
level( [ LEVEL ] )
Access method to the LEVEL data member. If LEVEL is defined, the LEVEL data member will get its value. Returns the value of the LEVEL
data member.
default_message( [ MESSAGE ] )
Access method to the DEFAULT_MESSAGE data member. If MESSAGE is defined, the DEFAULT_MESSAGE data member will get its value. Returns
the value of the DEFAULT_MESSAGE data member.
log_line_numbers( [ BOOLEAN ] )
If this flag is set to true, the <called_by> string will hold the file that calls the subroutine and the line where the call is issued.
The default value is zero.
template( [ TEMPLATE ] )
Access method to the TEMPLATE data member. The TEMPLATE data member is a string that defines how the log entries will look like. The
default TEMPLATE is:
'[<date>] <<level>> <called_by><default_message><message>'
Where:
<date> will be replaced by a string that represent
the date. For example: 09/01/2000 17:00:13
<level> will be replaced by the level of the entry.
<called_by> will be replaced by a call trace string. For
example:
CGIDaemon::listen > MyCGIDaemon::accepted
<default_message> will be replaced by the value of the
DEFAULT_MESSAGE data member.
<message> will be replaced by the message string that
is sent to the C<write> method.
Returns the value of the TEMPLATE data member.
AUTHOR
Rani Pinchuk, rani@cpan.org
COPYRIGHT
Copyright (c) 2001-2002 Ockham Technology N.V. & Rani Pinchuk. All rights reserved. This package is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.
SEE ALSO IO::LockedFile(3)perl v5.10.0 2009-05-13 LogLite(3pm)