08-24-2010
Script For Deleting Contents of "Live" Log File
In our shop, we have a situation where a log file from our interface engine software has begun maxing out in file size (reaching the 32-bit "2147483647" limit). Currently, the only way to rectify this is to stop the interface and restart it, which generates a new log. Easy enough, but the interface is for a medical facility - so intermittent stops/starts is highly discouraged. I've tried deleting contents of the file (after first backing it up) with various commands. Although I get what APPEARS to be an emptied file, it shows the same file size when moved back into the directory where it's written to. When viewing the log, there IS blank space up to the "new" log entries - but the file size remains the same - thus, defeating my intent. Is there any way to clear the log file, and revert it back to zero-size, without having to shut down this interface? I cannot create a new file; it is appended with a PID, which has to remain the same. Thanks for any help.
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello All
Nice to meet you all here in this forum,
it's my 1rst time here
i'm asking about a little issue that i face
i added a ksh script that echo " please insert your name " and store the output to a login.log file.
the script is working fine with normal telnet
but Xstart is not working... (8 Replies)
Discussion started by: islam.said
8 Replies
2. Shell Programming and Scripting
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Discussion started by: shis100
7 Replies
3. Shell Programming and Scripting
Please show me how to make substitution over the contents of a file in a perl script.
In a perl script, the core part of substitution operation is
s/FINDPATTERN/REPLACEPATTERN/g;
However, I cannot figure out how to make the substitution occur over the contents of a file. The following... (3 Replies)
Discussion started by: LessNux
3 Replies
4. UNIX for Dummies Questions & Answers
Hi
I want to delete a line from a txt file for which the line number is user input. Say when user selects 19, the 19th line would be deleted from the file. Can anyone please provide me with a sed one liner for the same... I tried sed -i. The interaction would be like this
Enter the line to... (1 Reply)
Discussion started by: sudeep.id
1 Replies
5. Shell Programming and Scripting
Hi
I want to delete a line from a txt file for which the line number is user input. Say when user selects 19, the 19th line would be deleted from the file. Can anyone please provide me with a sed one liner for the same... I tried sed -i. The interaction would be like this
Enter the line... (4 Replies)
Discussion started by: sudeep.id
4 Replies
6. Shell Programming and Scripting
I am new to bash/shell scripting.
I want to find all the files in directory and subdirectories, which are not ends with “.zip” and which are contains in the file name “*.log*” or “*.out*”.
I know below command to get the files which ends with “.log”; but I need which are not ends with this... (4 Replies)
Discussion started by: Mallikgm
4 Replies
7. UNIX for Dummies Questions & Answers
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies
8. Shell Programming and Scripting
Hi!
I am having 02 files.
In first file" X" I am having 02 Columns
TCP-5100 Sybase_5100
TCP-5600 Sybase_5600
Second file "Y" for example--
:services (
:AdminInfo (
:chkpf_uid ("{A2F79713-B67D-4409-83A4-A90804E983E9}")
:ClassName (rule_services)
)
:compound ()... (12 Replies)
Discussion started by: shahid1632
12 Replies
9. Shell Programming and Scripting
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
LEARN ABOUT DEBIAN
dpkg::log::analyse
DPKG::Log::Analyse(3pm) User Contributed Perl Documentation DPKG::Log::Analyse(3pm)
NAME
DPKG::Log::Analyse - Analyse a dpkg log
VERSION
version 1.20
SYNOPSIS
use DPKG::Log;
my $analyser = DPKG::Log::Analyse->new('filename' => 'dpkg.log'); $analyser->analyse;
DESCRIPTION
This module is used to analyse a dpkg log.
METHODS
$analser = DPKG::Log::Analyse->new('filename' => 'dpkg.log')
$analyser = DPKG::Log::Analyse->new('log_handle' => $dpkg_log)
Returns a new DPKG::Log::Analyse object. Filename parameter can be omitted, it defaults to /var/log/dpkg.log.
Its possible to specify an existing DPKG::Log object instead of a filename. This will be used and overrides any filename setting.
$analyser->analyse;
Analyse the debian package log.
$analyser->newly_installed_packages
Return all packages which were newly installed in the dpkg.log.
$analyser->upgraded_packages
Return all packages which were upgraded in the dpkg.log.
$analyser->removed_packages
Return all packages which were removed in the dpkg.log.
$analyser->unpacked_packages
Return all packages which are left in state 'unpacked'.
$analyser->halfinstalled_packages
Return all packages which are left in state 'half-installed'.
$analyser->halfconfigured_packages
Return all packages which are left in state 'half-configured'.
$analyser->installed_and_removed_packages
Return all packages which got installed and removed.
SEE ALSO
DPKG::Log, DPKG::Log::Analyse::Package
AUTHOR
Patrick Schoenfeld <schoenfeld@debian.org>.
COPYRIGHT AND LICENSE
Copyright (C) 2011 Patrick Schoenfeld <schoenfeld@debian.org>
This library is free software. You can redistribute it and/or modify it under the same terms as perl itself.
perl v5.10.1 2011-02-26 DPKG::Log::Analyse(3pm)