Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Log file not getting generated Post 302460529 by ajincoep on Thursday 7th of October 2010 03:10:12 AM
Old 10-07-2010
Log file not getting generated

Hi ,

Log file is not getting generated. any suggestion? Thanks

Code:
date1=$(date '+%m/%d/%y-%H:%M:%S')
log="wrapper.log.$date1"
echo " somethng" > $log

 

10 More Discussions You Might Find Interesting

1. Programming

Core File Not Being Generated in AIX

I have created an executable using my login session in an AIX Version 5 Unix system. After to which I have change the file mode to set uid and rwsrwx--x and ownership to root:system by using the following Standard C Library functions. chmod (name, S_ISUID|S_IRWXU|S_IRWXG|S_IXOTH|S_IROTH) chown... (6 Replies)
Discussion started by: S.P.Prasad
6 Replies

2. Shell Programming and Scripting

Automatically Rename Last Generated File

I'm trying to rename the last generated file in a given directory using a makefile. If I type 'make build' the 'build' target produces a file (ie: text_001.txt). It automatically generates them sequentially, so I don't have control over the name. I can't say that it will always be text_001.txt.... (2 Replies)
Discussion started by: pieter023
2 Replies

3. Shell Programming and Scripting

get the last generated log file

Hi I need to get the last generated file in a directory using ls -ltr. I need to store the output of ls -ltr in a variable. it will like this $xyz = -rw-rw-r-- 1 sblp003 siebel 1060 Dec 18 13:33 from this output, I need to do a substring to get this value alone "Dec 18... (8 Replies)
Discussion started by: ragha81
8 Replies

4. Linux

Core file not getting generated!!

Some strange behavior. Process is receiving Segmentation Fault. But no core files getting generated. I have checked ulimit. coredumpsize = unlimited. In console, process is printing Segmentation Fault even through gdb also same behavior But No corefile. Any possible reason ? ... (3 Replies)
Discussion started by: ashokd001
3 Replies

5. Shell Programming and Scripting

Retrieve logs generated in last 10 mins from a log file using 'grep' command

HI All, I have a log file where the logs will be in the format as given below: 2011-05-25 02:32:51 INFO PROCESS STARTING 2011-05-25 02:32:52 INFO PROCESS STARTED . . . I want to retrieve only the logs which are less than 5 mins older than current time using grep... (3 Replies)
Discussion started by: rvhg16
3 Replies

6. Shell Programming and Scripting

Copy latest generated file

Hi, There is csv file generated at /usr/data on server1 on monthly basis. It is in the format reportYYYYDD(e.g 201105). I needed a script which would copy the latest generated file from the location to another server at /usr/loc Please can you help? (2 Replies)
Discussion started by: Alok Ranjan
2 Replies

7. Shell Programming and Scripting

Script to grep for a string in log files generated in last 15 minutes.

Dear Guru's I've a requirment to grep for a string in series of log files that are getting generated almost every minute. I'm looking to schedule a script every 15 mountes,in order to check if the error string has been generated in any of the log files generated in last 15 minutes. Please... (3 Replies)
Discussion started by: rajivatnova
3 Replies

8. Shell Programming and Scripting

Move all .log except those generated in the last 5 minutes

RHEL 5.8 In the directory /u03/pkms/app_logs I have several hundreds of log files as shown below. $ pwd /u03/pkms/app_logs $ ls -alrt *.log | tail -50 -rw-r----- 1 oracle dba 9439232 May 4 13:57 mvtpcem_1_722892404_94157.log -rw-r----- 1 oracle dba 9227264 May 4 13:57... (8 Replies)
Discussion started by: kraljic
8 Replies

9. Shell Programming and Scripting

Log file being not generated in crontab

My shell script it.sh #!/bin/sh ORACLE_HOME=/var/opt/oracle/product/10g; export ORACLE_HOME PATH=$PATH:$ORACLE_HOME/bin:/bin:/usr/bin; export PATH today=`date "+%m-%d-%Y %H:%M:%S"`; export today CUR_DIR=$1; export CUR_DIR LOG_FILE=error.log; export LOG_FILE # Direct script output to... (4 Replies)
Discussion started by: rafa_fed2
4 Replies

10. Shell Programming and Scripting

How to capture hostnames or ip address in the log files generated?

Team, I have prepared a script which I run from my remote machine(Jump-box)server Below is the script FILEDATE=`date +%F` LOGFILE=/home/abc/scripts/xyz.$FILEDATE.log find /home/abc/scripts/xyz.*.log -type f -mtime -3 -delete touch $LOGFILE exec 1>$LOGFILE 2>&1 #healthcheck batch runs... (1 Reply)
Discussion started by: whizkidash
1 Replies
Log::Any::Test(3pm)					User Contributed Perl Documentation				       Log::Any::Test(3pm)

NAME
Log::Any::Test -- Test what you're logging with Log::Any SYNOPSIS
use Test::More; use Log::Any::Test; # should appear before 'use Log::Any'! use Log::Any qw($log); # ... # call something that logs using Log::Any # ... # now test to make sure you logged the right things $log->contains_ok(qr/good log message/, "good message was logged"); $log->does_not_contain_ok(qr/unexpected log message/, "unexpected message was not logged"); $log->empty_ok("no more logs"); # or my $msgs = $log->msgs; cmp_deeply($msgs, [{message => 'msg1', level => 'debug'}, ...]); DESCRIPTION
"Log::Any::Test" is a simple module that allows you to test what has been logged with Log::Any. Most of its API and implementation have been taken from Log::Any::Dispatch. Using "Log::Any::Test" sends all subsequent Log::Any log messages to a single global in-memory buffer. It should be used before Log::Any. METHODS
The test_name is optional in the *_ok methods; a reasonable default will be provided. msgs () Returns the current contents of the global log buffer as an array reference, where each element is a hash containing a category, level, and message key. e.g. { category => 'Foo', level => 'error', message => 'this is an error' }, { category => 'Bar::Baz', level => 'debug', message => 'this is a debug' } contains_ok ($regex[, $test_name]) Tests that a message in the log buffer matches $regex. On success, the message is removed from the log buffer (but any other matches are left untouched). does_not_contain_ok ($regex[, $test_name]) Tests that no message in the log buffer matches $regex. empty_ok ([$test_name]) Tests that there is no log buffer left. On failure, the log buffer is cleared to limit further cascading failures. contains_only_ok ($regex[, $test_name]) Tests that there is a single message in the log buffer and it matches $regex. On success, the message is removed. clear () Clears the log buffer. SEE ALSO
Log::Any, Test::Log::Dispatch AUTHOR
Jonathan Swartz COPYRIGHT &; LICENSE Copyright (C) 2009 Jonathan Swartz, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.1 2009-12-08 Log::Any::Test(3pm)
All times are GMT -4. The time now is 10:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy