Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Copy log based on from-date and to-date Post 302920230 by AbhiJ on Wednesday 8th of October 2014 09:27:06 AM
Old 10-08-2014
Thanks Vbe.

actually i have logs files with huge data and they are size based on 500mb new log file generated.

to coy those files for troubleshotting is very difficult.

my log files contains data from a month for example. now customer wants to create a utility where he can give FROM date and TO date and only logs between these two dates are copied to new files. there are several files with different name. thats my next challenge to have the new files with same name but as of now i need the specific date logs.
i tried last 2 days files and that worked but if i want logs from 15-sep to 16-sep then its issue.


sample logs :
Code:
630a4061dad .Error: com.avocent.commonplatform.mss.exceptions.MssServiceCommunicationException: MSS-400002
[2014-08-18T05:44:55.011-04:00] [adf_server] [ERROR] [] [com.avocent.commonplatform.mss.service.command.BaseCommandService] [tid: 18] [userId: ] [ecid: 0050EGrHF5O3R9hpP8c9yd0001s00006vY,0:1] [APP: ear-assembly#V2.0] Failed request to Engine 0a12aed1-8d44-4f79-bb72-9630a4061dad .Error: com.avocent.commonplatform.mss.exceptions.MssServiceCommunicationException: MSS-400002
[2014-08-18T09:15:44.563-04:00] [adf_server] [ERROR] [] [com.avocent.commonplatform.mss.service.command.BaseCommandService] [tid: 23] [userId: ] [ecid: 0050ESd2pPB3R9hpP8c9yd0001s00000EF,0:1] [APP: ear-assembly#V2.0]Failed request to Engine 0a12aed1-8d44-4f79-bb72-9630a4061dad .Error: com.avocent.commonplatform.mss.exceptions.MssServiceCommunicationException: MSS-400002
[2014-08-21T06:02:55.028-04:00] [adf_server] [ERROR] [] [com.avocent.commonplatform.mss.service.command.BaseCommandService] [tid: 22] [userId: ] [ecid: 0050I3HClg13R9hpP8c9yd0007nF00010y,0:1] [APP: ear-assembly#V2.0]Failed request to Engine 57bc42cc-f5e0-4325-80d8-1b506a7d86f0 .Error: com.avocent.commonplatform.mss.exceptions.MssServiceCommunicationException: MSS-400002
[2014-08-25T03:08:09.206-04:00] [adf_server] [ERROR] [] [com.avocent.commonplatform.mss.service.command.BaseCommandService] [tid: 24] [userId: sysplatformmss] [ecid: 0050MvOxiWC3R9hpP8c9yd0007nF0005RQ,0:1] [APP: ear-assembly#V2.0 Datapoint definition not mapped to the managed element datapointDefTypeId : 0c3b972e-613a-449d-948d-3c4cc1b30281 | [com.avocent.commonplatform.mss.service.command.BaseCommandService


Last edited by Franklin52; 10-08-2014 at 11:31 AM.. Reason: Please use code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Processing a log file based on date/time input and the date/time on the log file

Hi, I'm trying to accomplish the following and would like some suggestions or possible bash script examples that may work I have a directory that has a list of log files that's periodically dumped from a script that is crontab that are rotated 4 generations. There will be a time stamp that is... (4 Replies)
Discussion started by: primp
4 Replies

2. Shell Programming and Scripting

Copy files based on modification date

How to copy files from a location to a directory <YYMM> based on last modification date? This will need to run daily. I want to copy those file for May to 0905 and Jun to 0906. Appreciate your guidance.:) Thanks. -rw-rw-rw- 1 ttusr tgrp 4514 May 29 21:49 AB24279J.lot_a... (17 Replies)
Discussion started by: KhawHL
17 Replies

3. Shell Programming and Scripting

Copy files based on date

Hi all i am having so many files in my directory.Is there any option to copy files based on date. example i am having file this -rw-rw-r-- 1 ram user 1 Feb 2 17:12 abc -rw-rw-r-- 1 ram user 1 Feb 2 17:12 bnw -rwxrwxr-x 1 ram user 21122 Feb 4... (3 Replies)
Discussion started by: suryanarayana
3 Replies

4. Shell Programming and Scripting

Copy files based on last created date

Hi, I have a requirement to copy files from a windows network drive to a Linux server using shell script based on the last created date. Ex: FileName CreatedDate/Time F1 05-01-2012 3:00 PM F2 05-01-2012 3:15 PM F3 05-01-2012 2:00 PM When i run the shell script... (1 Reply)
Discussion started by: Lee_10
1 Replies

5. Shell Programming and Scripting

Find and copy files based on todays date and search for a particular string

Hi All, I am new to shell srcipting. Problem : I need to write a script which copy the log files from /prod/logs directory based on todays date like (Jul 17) and place it to /home/hzjnr0 directory and then search the copied logfiles for the string "@ending successfully on Thu Jul 17". If... (2 Replies)
Discussion started by: mail.chiranjit
2 Replies

6. Shell Programming and Scripting

Script to determine Date,TotalFile,total size of file based on date

I have file listed like below -rw-r--r--+ 1 test test 17M Nov 26 14:43 test1.gz -rw-r--r--+ 1 test test 0 Nov 26 14:44 test2.gz -rw-r--r--+ 1 test test 0 Nov 27 10:41 test3.gz -rw-r--r--+ 1 test test 244K Nov 27 10:41 test4.gz -rw-r--r--+ 1 test test 17M Nov 27 10:41 test5.gz I... (5 Replies)
Discussion started by: krish2014
5 Replies

7. UNIX for Dummies Questions & Answers

Find the count of files by last created date based on the given date range

My unix version is IBM AIX Version 6.1 I tried google my requirement and found the below answer, find . -newermt “2012-06-15 08:13" ! -newermt “2012-06-15 18:20" But newer command is not working in AIX version 6.1 unix I have given my requirement below: Input: atr files: ... (1 Reply)
Discussion started by: yuvaa27
1 Replies

8. HP-UX

HP/UX command to pull file name/date based on date

HI, Can anyone tell me how to pull the date and file name separated by a space using the find command or any other command. I want to look through several directories and based on a date timeframe (find -mtime -7), output the file name (without the path) and the date(in format mmddyyyy) to a... (2 Replies)
Discussion started by: lnemitz
2 Replies

9. Shell Programming and Scripting

Script to copy creation date over top of modified date?

Can someone draw up a script that for every file, folder and subfolder and files that will copy the creation date over top of the modified date?? I know how to touch every file recursively, but no idea how to read a files creation date then use that to touch the modification date of that file,... (3 Replies)
Discussion started by: toysareforboys
3 Replies

10. UNIX for Beginners Questions & Answers

Find and copy .zip file based on today's date

Hi Team, I'm new to unix and i have a requirement to copy or move files from one directory to another based on current date mentioned in the .zip file name. Note that i need to copy only the recent zip file. please help me with the code i tried the code as: #! /usr/bin/sh find... (3 Replies)
Discussion started by: midhun3108
3 Replies
DATETIME.SETDATE(3)							 1						       DATETIME.SETDATE(3)

DateTime::setDate - Sets the date

       Object oriented style

SYNOPSIS
public DateTime DateTime::setDate (int $year, int $month, int $day) DESCRIPTION
Procedural style DateTime date_date_set (DateTime $object, int $year, int $month, int $day) Resets the current date of the DateTime object to a different date. PARAMETERS
o $object -Procedural style only: A DateTime object returned by date_create(3). The function modifies this object. o $year - Year of the date. o $month - Month of the date. o $day - Day of the date. RETURN VALUES
Returns the DateTime object for method chaining or FALSE on failure. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.3.0 | | | | | | | Changed the return value on success from NULL to | | | DateTime. | | | | +--------+---------------------------------------------------+ EXAMPLES
Example #1 DateTime.setDate(3) example Object oriented style <?php $date = new DateTime(); $date->setDate(2001, 2, 3); echo $date->format('Y-m-d'); ?> Procedural style <?php $date = date_create(); date_date_set($date, 2001, 2, 3); echo date_format($date, 'Y-m-d'); ?> The above examples will output: 2001-02-03 Example #2 Values exceeding ranges are added to their parent values <?php $date = new DateTime(); $date->setDate(2001, 2, 28); echo $date->format('Y-m-d') . " "; $date->setDate(2001, 2, 29); echo $date->format('Y-m-d') . " "; $date->setDate(2001, 14, 3); echo $date->format('Y-m-d') . " "; ?> The above example will output: 2001-02-28 2001-03-01 2002-02-03 SEE ALSO
DateTime.setISODate(3), DateTime.setTime(3). PHP Documentation Group DATETIME.SETDATE(3)
All times are GMT -4. The time now is 12:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy