Sponsored Content
Top Forums Shell Programming and Scripting Help needed on Perl Script to Handle Log files that are rotated using logrotate Post 302714769 by DGPickett on Friday 12th of October 2012 03:12:42 PM
Old 10-12-2012
In general scripting pseudo-code, create a marker file with the last line # you examined in it immediately at the end of the scan. On the next pass, find files newer than the marker file and concatenate them to standard in, discarding the number of lines in the marker file. This way, the script only sees new lines from new files. If during the last scan there were logs log1 to log87 and log being written, and you saw 3214 lines of that file, later when you return there might be logs log1 to log99, but you want to start after line 3214 of log88 examining through log99 and then log.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

flexible sed command needed to handle multiple input types

Hello, I need a smart sed command that can take any of the following two as an input and give below mentioned output. As you can see, I am trying to convert some C code INPUT: struct abc_sample1 { char myString; UINT16 myValue1; ... (2 Replies)
Discussion started by: SiftinDotCom
2 Replies

2. UNIX for Advanced & Expert Users

how to logrotate log files

Hi, I have written a script that runs every five minutes in cron schedular. The Operating system is Fedora core 9. This script generates 2 log files, these log file size is increasing as some log data is being dumped into these 2 log files every five minutes. I need to logrotate these 2 files.... (1 Reply)
Discussion started by: renuka
1 Replies

3. Shell Programming and Scripting

Perl Script Help Needed

I need this script to be able to check both IPs that are given to it and exit with an OK... if one of those expected IPs is returned. The script is run like this: /bin/dns_checker.pl -s 69.34.55.66 -q htt.jababa.com -e 69.44.56.33,45.47.43.55 Right now, the script is failing, but when I... (4 Replies)
Discussion started by: SkySmart
4 Replies

4. Shell Programming and Scripting

Perl script help needed..

Hi, I am new to perl scripting. Can anybody help me in solving the below problem. I have file, which is called map_file. According to map_file's last column data, i need a output file, which has repeats as like the map_file's last column name. Thank you in advance Vasanth (5 Replies)
Discussion started by: vasanth.vadalur
5 Replies

5. Shell Programming and Scripting

Perl script needed

For the following command I need a perl script equivalent with a couple of more things - cat /tmp/mail |grep Appname > /tmp/mail1;cat /tmp/mail >> /tmp/mail1; mail -s "mail subject here" allan@mail.com < /tmp/mail1; >/tmp/mail ; >/tmp/mail1 ================== cat /tmp/mail ***** Alert *****... (4 Replies)
Discussion started by: jacki
4 Replies

6. Shell Programming and Scripting

A small help needed in Logrotate

Hi, I wanted to know can a custom script can be made available to run in postroate endscript something like postrotate ./scriptpath/sh-script.sh endscript Is this the correct syntax, or it will require any modification? Thanks in Advance. Neeryan (1 Reply)
Discussion started by: Neeryan
1 Replies

7. Shell Programming and Scripting

Help needed urgently. Look back for files in PERL

I have 3 variables $file =abc_2011_11_01.txt (current day file) $back = Yes $forward = No I need to search for 3 days back files / 3 days forward files if my current file is not present logic is, I need to download the current day file. If it is missing, i need to look out for... (1 Reply)
Discussion started by: irudayaraj
1 Replies

8. Shell Programming and Scripting

Help needed with Perl Script

i have the following script: #!/usr/local/bin/perl use STUN::Client; use Data::Dumper; use strict; my $stun_client = STUN::Client->new; $stun_client->stun_server('10.59.29.14'); my $r = $stun_client->get; my $ip = $r->{ma_address}; print "IP: $ip\n\nResult (hash):... (5 Replies)
Discussion started by: SkySmart
5 Replies

9. Debian

Logrotate truncated my log files to 0 bytes and no logs are written

Hi, Yesterday I installed and configured logrotate on my Debian machine. I was expecting this to run at 06:25 in the morning and it actually did. All my old logs were compressed and zipped but the new logs were all with size equal to 0 bytes. Processes, while still running ok, they were not... (2 Replies)
Discussion started by: pmatsinopoulos
2 Replies

10. Shell Programming and Scripting

Logrotate - I am not able to rotate files using logrotate

I have written script which is working in Home directory perfectly and also compressing log files and rotating correctly. But, when i try to run script for /var/log/ i am able to get compressed log files but not able to get rotation of compressed log files. Please suggest. I am using below command... (5 Replies)
Discussion started by: VSom007
5 Replies
Bio::PopGen::Marker(3pm)				User Contributed Perl Documentation				  Bio::PopGen::Marker(3pm)

NAME
Bio::PopGen::Marker - A genetic marker which one uses to generate genotypes SYNOPSIS
my $name = $marker->name(); # marker name my $description = $marker->description(); # description my $type = $marker->type(); # coded type of the marker my $unique_id = $marker->unique_id; # optional unique ID my @alleles = $marker->get_Alleles(); # the known alleles my %allele_freqs = $marker->get_Allele_Frequencies(); # keys are marker names # vals are frequencies # may change to handle multiple populations DESCRIPTION
This object will not contain genotype information pertaining to an individual, but rather population level statistics and descriptive information about a marker. FEEDBACK
Mailing Lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists Support Please direct usage questions or support issues to the mailing list: bioperl-l@bioperl.org rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. Reporting Bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ AUTHOR - Jason Stajich Email jason-at-bioperl.org CONTRIBUTORS
Matthew Hahn, matthew.hahn-at-duke.edu APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ new Title : new Usage : my $obj = Bio::PopGen::Marker->new(); Function: Builds a new Bio::PopGen::Marker object Returns : an instance of Bio::PopGen::Marker Args : -name => [string] marker name -description => [string] marker description -type => [string] marker type -unique_id => [string/int] unique id -allele_freq => [hash ref] allele frequencies name Title : name Usage : my $name = $marker->name(); Function: Get the name of the marker Returns : string representing the name of the marker Args : [optional] name description Title : description Usage : my $desc = $marker->description Function: Get the marker description free text Returns : string Args : [optional] string type Title : type Usage : my $type = $marker->type; Function: Get coded string for marker type Returns : string Args : [optional] string unique_id Title : unique_id Usage : my $id = $marker->unique_id; Function: Get the unique marker ID Returns : unique ID string Args : [optional ] string annotation Title : annotation Usage : my $annotation_collection = $marker->annotation; Function: Get/set a Bio::AnnotationCollectionI for this marker Returns : Bio::AnnotationCollectionI object Args : [optional set] Bio::AnnotationCollectionI object get_Alleles Title : get_Alleles Usage : my @alleles = $marker->get_Alleles(); Function: Get the available marker alleles Returns : Array of strings Args : none get_Allele_Frequencies Title : get_Allele_Frequencies Usage : my %allele_freqs = $marker->get_Allele_Frequencies; Function: Get the alleles and their frequency (set relative to a given population - you may want to create different markers with the same name for different populations with this current implementation Returns : Associative array where keys are the names of the alleles Args : none add_Allele_Frequency Title : add_Allele_Frequency Usage : $marker->add_Allele_Frequency($allele,$freq) Function: Adds an allele frequency Returns : None Args : $allele - allele name $freq - frequency value reset_alleles Title : reset_alleles Usage : $marker->reset_alleles(); Function: Reset the alleles for a marker Returns : None Args : None perl v5.14.2 2012-03-02 Bio::PopGen::Marker(3pm)
All times are GMT -4. The time now is 10:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy