Sponsored Content
Top Forums Shell Programming and Scripting split monthly logfiles into daily logfiles Post 302256051 by BubbaJoe on Friday 7th of November 2008 07:07:29 PM
Old 11-07-2008
for i in `ls foo*.log`
do
awk ' {f="foo"$1".log"; print > f}' $i
done
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Logfiles

My server has only has access logs turned on. How do I turn on the other standard logs (i.e. I'd like to see the referring urls). Thanks in advance. (3 Replies)
Discussion started by: pingdom
3 Replies

2. UNIX for Dummies Questions & Answers

Controlling logfiles

I support an app that outputs alert and audit messages to one log file (vendor says they can't be separated). The script that I have written takes a copy (mv cmd) of the file to do the separation and reformatting. I have a problem that I loose records (messages are being written constantly, upto 3+... (5 Replies)
Discussion started by: nhatch
5 Replies

3. UNIX for Advanced & Expert Users

Output all commands to logfiles ???

Dear Forum, My .cshrc settings are embedded in a massive jungle of code distributed all over the place, where finding anything is a "needle in a haystack" daily pain in the royal backside. Is there anyway, i can dump out every command and file executed to STDOUT after sourcing my .cshrc ??? ... (2 Replies)
Discussion started by: fawqati
2 Replies

4. Shell Programming and Scripting

Logfiles E-mailed

Hi All There are some cron jobs ,which runs 24 hrs. Log files are generated when one job fails. So I need the log files to be emailed to my personal e-mail id. So that I can see the log files at my home If there is any error. How can I implement this in Unix shell programming. Thanks... (4 Replies)
Discussion started by: deep_kol
4 Replies

5. Shell Programming and Scripting

parsing logfiles (performance issue)

-------------------------------------------------------------------------------- Hi All, I am reading some logfiles and parsing data and printing to some textfile. Here is my code OLDIFS=$IFS IFS=' ' # just a newline, in single quotes while read data do if then #Parsing the... (4 Replies)
Discussion started by: subin_bala
4 Replies

6. Shell Programming and Scripting

Logfiles

Hi All, I have a peculiar problem. I will call a script from another script. Script abc.ksh is called by ABC.ksh as ABC.ksh abc.ksh in abc.ksh I will create and redirect all the statements to log file. ABC.ksh will also has a log file. I want all the logs generated in file abc in ABC... (5 Replies)
Discussion started by: javeed7
5 Replies

7. UNIX for Dummies Questions & Answers

Gzip many logfiles in one time

Hi All, I am working on a script and i am now been stuck in the mid of it.. My Script actually list the files consuming large disk it need compress the log files.. Here are the files Hello_2009_10_22.log Hello_2009_10_23.log.gz Hello_2009_10_24.log.gz Hello_2009_10_22.log... (2 Replies)
Discussion started by: sumithra
2 Replies

8. Red Hat

logrotate httpd logfiles

Hi, I need to logrotate logs in directories in /var/log/httpd/. There are 4 directories in /var/log/httpd/... these directories are /var/log/httpd/access/ /var/log/httpd/debug/ /var/log/httpd/error/ /var/log/httpd/required/ Each of the access, required, error and debug directories have around... (1 Reply)
Discussion started by: renuka
1 Replies

9. Shell Programming and Scripting

How to find ip addresses in logfiles?

Hi guys, I need to check a few log files as below to find out whether certain ip addresses is present on these log files. type8code0: ls -alt -rw-r--r-- 1 root other 796219588 Mar 20 02:25 logfile drwxr-xr-x 2 root root 1536 Mar 20 02:00 . -rw-r--r-- ... (3 Replies)
Discussion started by: type8code0
3 Replies

10. HP-UX

The life cycle of System logfiles

Hi , The log files of the system are located in /var/admin/syslog , I want to know on which way the files are generated. To be more clear for example old log files are deleted automatically from the sytem ( is that configured ? if yes what is the criteria: is it file volume or file date or ..)... (5 Replies)
Discussion started by: enabbou
5 Replies
Refs(3pm)						User Contributed Perl Documentation						 Refs(3pm)

NAME
SGMLS::Refs - Forward reference handling SYNOPSIS
use SGMLS::Refs; To create a new reference-manager object using the file "foo.refs": my $refs = new SGMLS::Refs("foo.refs"); To create a new reference-manager object using the file "foo.refs" and logging changes to the file "foo.log": my $refs = new SGMLS::Refs("foo.refs","foo.log"); To record a reference: $refs->put("document title",$title); To retrieve a reference: $title = $refs->get("document title"); To return the number of references changed since the last run: $num = $refs->changed; To print a LaTeX-like warning if any references have changed: $refs->warn; DESCRIPTION
This library can be used together with the SGMLS package to keep track of forward references from one run to another, like the LaTeX ".aux" files. Each reference manager is an object which reads and then rewrites a file of perl source, with the file name provided by the caller. Example: # Start up the reference manager before the parse. sgml('start', sub { $refs = new SGMLS::Refs("foo.refs"); }); # Warn about any changed references at the end. sgml('end', sub { $refs->warn; }); # Look up the title from the last parse, if available. sgml('<div>', sub { my $element = shift; my $id = $element->attribute(ID)->value; my $title = $refs->get("title:$id") || "[no title available]"; $current_div_id = $id; output "\section{$title} "; }); # Save the title for the next parse. sgml('<head>', sub { push_output('string'); }); sgml('</head>', sub { my $title = pop_output(); my $id = $current_div_id; $refs->put("title:$id",$title); }); AUTHOR AND COPYRIGHT
Copyright 1994 and 1995 by David Megginson, "dmeggins@aix1.uottawa.ca". Distributed under the terms of the Gnu General Public License (version 2, 1991) -- see the file "COPYING" which is included in the SGMLS.pm distribution. SEE ALSO
: SGMLS, SGMLS::Output. perl v5.8.8 2004-02-22 Refs(3pm)
All times are GMT -4. The time now is 08:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy