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
fstrace_setlog
FSTRACE_SETLOG(8) AFS Command Reference FSTRACE_SETLOG(8)
NAME
fstrace_setlog - Sets the size of a trace log
SYNOPSIS
fstrace setlog [-log <log name>+]
-buffersize <1-kilobyte units> [-help]
fstrace setl [-l <log name>+]
-b <1-kilobyte units> [-h]
DESCRIPTION
The fstrace setlog command defines the number of kilobytes of kernel memory allocated for the "cmfx" trace log. If kernel memory is
currently allocated, the command clears the current log and creates a new log buffer of the specified size.
To display the current defined size of the log buffer, issue the fstrace lslog command with the -long argument. To control whether the
indicated amount of space is actually allocated, use the fstrace setset command to set the status of the "cm" event set; to display the
event set's status, use the fstrace lsset command.
OPTIONS
-log <log name>+
Names trace log for which to set the size. The only acceptable value is "cmfx", which is also the default if this argument is omitted.
-buffersize <1-kilobyte units>
Specifies the number of 1-kilobyte blocks of kernel memory to allocate for the trace log.
-help
Prints the online help for this command. All other valid options are ignored.
EXAMPLES
The following command allocated 80 KB of kernel memory for the "cmfx" trace log:
# fstrace setlog -log cmfx -buffersize 80
PRIVILEGE REQUIRED
The issuer must be logged in as the local superuser "root".
SEE ALSO
fstrace(8), fstrace_lslog(8), fstrace_lsset(8), fstrace_setset(8)
COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved.
This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas
Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell.
OpenAFS 2012-03-26 FSTRACE_SETLOG(8)