Hi,
I am planning to implement a scheduled script that will go against my log files (every hour), search for a set of key words (errors, exceptions, faults etc). The script must be intelligent enough to scan only the new lines added to the log file since it last ran.
I can use grep for... (3 Replies)
Hi everyone , i m working on Sun solaris and i have a file "smsapp.cur" which has information like this paragraph given below , there are millions of such paragraphs
From:923212802736
To:923222326807
logMessage: 07-04-08 17:34:29 Getting message topup from code page default in language English... (2 Replies)
How can i scan a file in a UNIX script and look for a particular keyword?
For example if i wanted to scan the file "lpcmp165.out" and see if it contains the term "error" or "ERROR" and then return a 0 or 1 or some indicator as such?
Detail example:
sqlplus -s xx/yyyyyyy#@zzz <<EOF >... (11 Replies)
Hi
I am working on a script which needs to scan a sequential file and fetch the row where 2nd column = 'HUB'
Can any one help me with this...
Thanks (1 Reply)
hi guys,
i am very new to scripting & lookin for a shell script/perl script which would scan another file with the keyword "no change" & take a count of the same. Let me know if any further details are required. (3 Replies)
I need to read the last line of a log file and save it, sleep for X minutes and read the last line again. If the line is the same, exit 1, otherwise sleep for X minutes until the last line contains 'Status: Process completed'. Can anyone offer advice here? Thanks. (2 Replies)
Hi everyone.
I am still new to UNIX, and am having trouble figuring out how to create a script to scan a log file to look for errors based on a string.
We run AIX 5.3, and would like the ability to report all the instances of WebSphere Broker Execution groups crashing. This script would... (8 Replies)
Hi
Please I dont have a lot of redhat skills, but I need some help on creating a file system.
I need to rescan for this new LUN, so I try to check existing LUNs:
fdisk -l
Disk /dev/sda: 299.4 GB, 299439751168 bytes
255 heads, 63 sectors/track, 36404 cylinders
Units = cylinders of... (8 Replies)
Hi
I have a system running uname -a
Linux cmoveldb02 3.2.0-29-generic #46-Ubuntu SMP Fri Jul 27 17:03:23 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux and I was told by the NetApp Admin that he has provided 5 LUNs of 1Tb, 200Gb and remaining 3 of 300Gb, but I am not able to see the new LUNs.
I have... (4 Replies)
The below bash runs clamav on all files in DIR and produces virus-scan.log. My question is the portion in bold is supposed to move the infected files, lines not OK, to /home/cmccabe/quarantine. Does the bash look correct? Thank you :).
virus-scan.log
Mon Jan 16 14:39:05 CST 2017... (5 Replies)
Discussion started by: cmccabe
5 Replies
LEARN ABOUT DEBIAN
file::scan
Scan(3pm) User Contributed Perl Documentation Scan(3pm)NAME
File::Scan - Perl extension for Scanning files for Viruses
SYNOPSIS
use File::Scan;
$fs = File::Scan->new([, OPTION ...]);
$fs->set_callback(
sub {
my $filename = shift;
my $bytes = shift;
...
return("Callback Value");
}
);
$fs->scan([FILE]);
if(my $e = $fs->error) { print "$e
"; }
if(my $c = $fs->skipped) { print "file skipped ($c)
"; }
if($fs->suspicious) { print "suspicious file
"; }
if(my $res = $fs->callback) { print "$res
"; }
DESCRIPTION
This module is designed to allows users to scan files for known viruses. The purpose is to provide a perl module to make plataform
independent virus scanners.
METHODS
new([, OPTION ...])
This method create a new File::Scan object. The following keys are available:
callback => 'subroutine reference'
if the item is set then use a callback subroutine reference to provide extra information and functionalities. The callback
subroutine have two arguments: filename and first 1024 bytes read from the file. This only work for binary files.
extension => 'string'
add the specified extension to the infected file
move => 'directory'
move the infected file to the specified directory
copy => 'directory'
copy the infected file to the specified directory
mkdir => octal_number
if the value is set to octal number then make the specified directories (example: mkdir => 0755).
delete => 0 or 1
if the value is set to 1 delete the infected file
max_txt_size => 'size in kbytes'
scan only the text file if the file size is less then max_txt_size. The default value is 5120 kbytes. Set to 0 for no limit.
max_bin_size => 'size in kbytes'
scan only the binary file if the file size is less then max_bin_size. The default value is 10240 kbytes. Set to 0 for no limit.
scan([FILE])
This method scan a file for viruses and return the name of virus if a virus is found.
set_callback([SUBREF])
This method is another way to install a callback subroutine reference. Take a look in callback kay.
skipped()
This method return a code number if the file was skipped and 0 if not. The following skipped codes are available:
0 file not skipped
1 file is not vulnerable
2 file has zero size
3 the size of file is small
4 the text file size is greater that the 'max_txt_size' argument
5 the binary file size is greater that the 'max_bin_size' argument
suspicious()
This method return 1 if the file is suspicious and 0 if not.
callback()
This method return the result from the callback subroutine.
error()
This method return a error message if a error happens.
AUTHOR
Henrique Dias <hdias@aesbuc.pt>
CREDITS
Thanks to Rui de Castro, Sergio Castro, Ricardo Oliveira, Antonio Campelo, Branca Silveira, Helena Gomes and Anita Afonso for the help.
Thanks to Fernando Martins for the personal collection of viruses.
SEE ALSO perl(1).
perl v5.10.0 2009-07-19 Scan(3pm)