I call it cut-trivial-cases-off-early-to-keep-things-simple+together+not-overly-indented logic, hate logic statements barefoot in flow, and like logging in unattended processes:
Code:
if [ ! -s $msg ]
then
date "+%Y-%m-%d %H:%M:%S ${0##*/} ($$) Discarding empty message '$msg'." >&2
continue ? exit ?
fi
Last edited by DGPickett; 04-29-2011 at 11:08 AM..
I'm using IBM AIX 5.2 to send file with ftp to other unix machine.
The command is into a shell:
...
ftp -n > outFtp 2> errFtp <<PARAM
open $2
user $3 $4
put $1 $remote
bye
PARAM
...
then i look at the size of errFtp and outFtp to see if there are some error message.... (4 Replies)
I want to create a script that emails a file created by Informix Ace if the file size is > 0. It is a list of exceptions. No exceptions...no message
This does not work:
THESIZE=`ls -lA /tmp/ds_treo.txt | awk -F' ' '{print $5}'`
if
then
(cat $DSDIR/ds_treo.txt) | mail -s "Treo... (1 Reply)
hi all,
in my server there are some specific application files which are spread through out the server... these are spread in folders..sub-folders..chid folders...
please help me, how can i find the total size of these specific files in the server... (3 Replies)
Hi,
We currently have an Oracle database running and it is creating lots of processes in the /proc directory that are 1000M in size. The size of the /proc directory is now reading 26T. How can this be if the root file system is only 13GB?
I have seen this before we an Oracle temp file... (6 Replies)
#!/bin/sh
##########################################################################################################
#This script is being used for AOK application for cleaning up the .out files and zip it under logs directory.
# IBM
# Created
#For pdocap201/pdoca202 .out files for AOK
#1.... (0 Replies)
I have a file like this. I need to ues this file to send emails to the appropriate ID/group.
For instance in the first line
- Subject should be --> "A1.csv - ABC"
- Body should be --> File A1.csv has changed.
- Email should be sent to A1@xyz.com,A3@xyz.com
Lookup.csv:
... (1 Reply)
I have been searching both on Unix.com and Google and have not been able to find the answer to my question. I think it is partly because I can't come up with the right search terms.
Recently, my virtual server switched storage devices and I think the problem may be related to that change.... (2 Replies)
HI Team,
I am working on reading hive table and send email in email body using shell script, can you please help on fixing the errors: I have 6 columns in my hive table and trying to send the email in the mail body.
below script:
#!/bin/bash
hive -e 'SELECT count(*) from db.table' >... (4 Replies)
Discussion started by: Mi4304
4 Replies
LEARN ABOUT DEBIAN
moosex::log::log4perl::easy
Easy(3pm) User Contributed Perl Documentation Easy(3pm)NAME
MooseX::Log::Log4perl::Easy - A role for easy usage of logging in your Moose based modules based on MooseX::Log::Log4perl
SYNOPSIS
package MyApp;
use Moose;
use Log::Log4perl qw(:easy);
with 'MooseX::Log::Log4perl::Easy';
BEGIN {
Log::Log4perl->easy_init();
}
sub foo {
my ($self) = @_;
$self->log_debug("started bar"); ### logs with default class catergory "MyApp"
$self->log_info('bar'); ### logs an info message
$self->log('AlsoPossible')->fatal("croak"); ### log
}
DESCRIPTION
The Easy logging role based on the MooseX::Log::Log4perl logging role for Moose directly adds the logmethods for all available levels to
your class instance. Hence it is possible to use
$self->log_info("blabla");
without having to access a separate log attribute as in MooseX::Log::Log4perl;
In case your app grows and you need more of the super-cow powers of Log4perl or simply don't want the additional methods to clutter up your
class you can simply replace all code "$self->log_LEVEL" with "$self->log->LEVEL".
You can use the following regex substitution to accomplish that:
s/log(_(trace|debug|info|warn|error|fatal))/log->$2/g
ACCESSORS
logger
See MooseX::Log::Log4perl
log
See MooseX::Log::Log4perl
log_fatal ($msg)
Logs a fatal message $msg using the logger attribute. Same as calling
$self->logger->fatal($msg)
log_error ($msg)
Logs an error message using the logger attribute. Same as calling
$self->logger->error($msg)
log_warn ($msg)
Logs a warn message using the logger attribute. Same as calling
$self->logger->warn($msg)
log_info ($msg)
Logs an info message using the logger attribute. Same as calling
$self->logger->info($msg)
log_debug ($msg)
Logs a debug message using the logger attribute. Same as calling
$self->logger->debug($msg)
log_trace ($msg)
Logs a trace message using the logger attribute. Same as calling
$self->logger->trace($msg)
SEE ALSO
MooseX::Log::Log4perl, Log::Log4perl, Moose
BUGS AND LIMITATIONS
Please report any bugs or feature requests to "bug-moosex-log4perl@rt.cpan.org", or through the web interface at <http://rt.cpan.org>.
Or come bother us in "#moose" on "irc.perl.org".
AUTHOR
Roland Lammel "<lammel@cpan.org>"
Inspired by suggestions by Michael Schilli "<m@perlmeister.com>"
Contributions from Tim Bunce "<TIMB@cpan.org>"
LICENSE AND COPYRIGHT
Copyright (c) 2008-2012, Roland Lammel "<lammel@cpan.org>", http://www.quikit.at
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
perl v5.14.2 2012-06-27 Easy(3pm)