Hi, Annihilannic. When you say, log rotated, you mean like the log is renamed? or refreshed? I have a separate script that is pulling the logfile remotely. I am maintaining the same name, but the next it copies could be a file with new records. So the file would change in that sense.
My Perl friends!
Thank you for your recent help on this parse log script. There are some changes I need to make on the logic of my code. Instead of filtering on date, I need to somehow keep track of the last record I parsed. I am basically pulling a copy of the log file on an hourly basis and...
@xhonzi - thanks for your input.
As for my data. Its not random. Although for every backup set I have, I am looking for particular attributes. But on occasion for some rows, the value will not be there.
What I would like to do is create as csv type datafile with this if possible.
Thanks.
@Franco - Thank you! This is great. You basically nailed what I've been trying to figure out as in understanding the structure of this. Yes, the $server has to be constant since I am mining all the backup values for each given log from $server. I added that key for that and wasn't sure if that...
Perl newbie here. I have some working code I strung up together with help from others along the way. I am still quite unclear of how I should approach this problem with using an array of hash, hash refs. Right now it works using hashes, but I was also advised I can use an array for thise too. As...
I have the following shell script:
#!/bin/bash
find /db1/sgl/backup/ -name "*sgl*" -mtime +20 -print | cut -c21-28 | while read RECORD
do
echo "ls -ltr *$RECORD*" >> listfiles.sh
done
The output file would look like this:
ls -ltr *sgl_p814*
But there are instances where the filename has...
Thank you Annihilannic! That's much shorter code. No, I didn't realize I can just call this. I'm still learning a lot on how to use perl. Thanks for the tip.
This seems to work, as I think I understand this correctly:
my $chkenv = `/bin/env`;
Then within, the open handle and a successful check, printed it out to the filehandle.
open (MYLOG, ">>/home/mylog") || die "cannot append $!";
my $rc = system ($runrc); #runs the command...
I am trying to capture output that I need, thus creating my own logfile after script execution. I am using the system() command to execute (2) programs.
The first one is calling another perl script, the second one is a simple printout of the environment, using 'env', but I want it to be...
I want to add and use a perl module called Finance::Quote using CPAN.
This is the first module that I had tried to add using CPAN.
I am doing this on my mac book pro that is running perl version 5.8 on mac osx (10.5.8, 2.4Ghz Intel Dual Core 2 Duo)
I am getting the following errors, try to...
I found out my problem. It works now. I used qx and build the filename from that.
my $datecnf = qx(date '+%Y%m%d'."cnf");
# Build system command to execute
my $get_cmd = "scp $hostname:/home/y/etc/my.cnf $datecnf";
So far I have this script running, but what I want to do is create a timestamped file, getting from date and then call it for example 20100319.cnf
I am having problems though trying to get the date part to append to the ".cnf" name.
I tried using "." to concatenate it. Apparently I don't...
So, comment out the my declaration for this and replace with a quote? Like this?
my $expdp='/home/oracle/product/11.1.0.6.0/bin/expdp parfile=/home/oracle/param/TST.par';
if (($checkrpc1 == 1) && ($checkrpc2 == 1)) {
print qq (\nBoth NFS rpc daemons are UP. $date);
send_email("Both NFS...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.