Sponsored Content
Top Forums Shell Programming and Scripting Extracting log files based on date and time. Post 302775911 by mahesh300182 on Tuesday 5th of March 2013 04:14:14 PM
Old 03-05-2013
Extracting log files based on date and time.

Hi All,

i have some log files generated in a folder daily with the format

abc.def.20130306.100001
ghi.jkl.20130306.100203
abc.def.20130305.100001
ghi.jkl.20130305.100203

the format is the date followed by time . all i want is to get the files that are generated for todays date alone.. please help...
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extracting date-time from file.

I have the following file and need to extract date and time part for each record. Pl. could anyone provide an shell script which could be used to do it. Here is the file: /rgrdev/pdsud2/unx/agc/src/agcmst: /rgrsrc/pdspms/unx/agc/src/s.agcmst.for agcmst.for 420.20 8/4/07 18:30:53 ... (7 Replies)
Discussion started by: skumar11
7 Replies

2. 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

3. Shell Programming and Scripting

Extracting lines in file based on time

Hi, anyone has any ideas on how do we extract lines from a file with format similiar to this: (based on current time) Jun 18 00:16:50 .......... ............. ............ Jun 18 00:17:59 .......... ............. ............ Jun 18 01:17:20 .......... ............. ............ Jun 18... (5 Replies)
Discussion started by: faelric
5 Replies

4. Shell Programming and Scripting

Getting date output based on time zone

Hi, We have a server in US and hence while the command "date" is given it gives the output in EDT. If I want the date output in MET, how can I get it. Please let me know how I could do it in the script which is ksh. Thanks. (1 Reply)
Discussion started by: jmathew99
1 Replies

5. Shell Programming and Scripting

Extracting date & time from file name

Hi, I am having a file name as exp_bkp_tables_18_Oct_2010_10_50_28.dmp which is used for import the records. Now, I want to print the output using the selected file name as below : Table records will get restored as on date 18-Oct-2010 and time 10:50:28 How it can be done ? With... (5 Replies)
Discussion started by: milink
5 Replies

6. Shell Programming and Scripting

Identify log files based on time stamp,zip and then copy..HELP

Hi All, PFB is a requirement. I am new to shell scripting. So plz help. It would be highly appreciated. 1. choose all the log files based on a particular date (files location is '/test/domain')--i.e,we should choose all the files that are modified on 29th November, neither 28th nor 30th 2.... (3 Replies)
Discussion started by: skdas_niladri
3 Replies

7. Shell Programming and Scripting

How to catch date and time from log files?

Hi, Appli.log files contain the below data which updates continuously ================================================== =============== Tuple Created OrderEntry|66|39.0|ADML.L|16.89|GBP||GFD|000002889 41ORLO1|GB00B02J6398|80|XLON|UHORIZON|null|2011-05-09... (11 Replies)
Discussion started by: pspriyanka
11 Replies

8. Shell Programming and Scripting

List Files Based On Time & Date

Hi All, I am using HP Unix. I want to list files which are created 5 minutes before on the same day as well as before today's date. I checked all the forums and the commands provided there does not work on HP Unix. Can you please help me on this? Your help is highly aprreciated. Thanks and... (3 Replies)
Discussion started by: angshuman
3 Replies

9. UNIX for Dummies Questions & Answers

Condition based on Timestamp (Date/Time based) from logfile (Epoch seconds)

Below is the sample logfile: Userids Date Time acb Checkout time: 2013-11-20 17:00 axy Checkout time: 2013-11-22 12:00 der Checkout time: 2013-11-17 17:00 xyz Checkout time: 2013-11-19 16:00 ddd Checkout time: 2013-11-21 16:00 aaa Checkout... (9 Replies)
Discussion started by: asjaiswal
9 Replies

10. 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
MONGOGRIDFS(3)								 1							    MONGOGRIDFS(3)

The MongoGridFS class

INTRODUCTION
Utilities for storing and retrieving files from the database. GridFS is a storage specification all supported drivers implement. Basically, it defines two collections: files, for file metadata, and chunks, for file content. If the file is large, it will automatically be split into smaller chunks and each chunk will be saved as a docu- ment in the chunks collection. Each document in the files collection contains the filename, upload date, and md5 hash. It also contains a unique _id field, which can be used to query the chunks collection for the file's content. Each document in the chunks collection contains a chunk of binary data, a files_id field that matches its file's _id, and the position of this chunk in the overall file. For example, the files document is something like: <?php array("_id" => 123456789, "filename" => "foo.txt", "chunkSize" => 3, "length" => 12); ?> <?php array("files_id" => 123456789, "n" => 0, "data" => new MongoBinData("abc")); array("files_id" => 123456789, "n" => 1, "data" => new MongoBinData("def")); array("files_id" => 123456789, "n" => 2, "data" => new MongoBinData("ghi")); array("files_id" => 123456789, "n" => 3, "data" => new MongoBinData("jkl")); ?> INTER-LANGUAGE COMPATIBILITY You should be able to use any files created by MongoGridFS with any other drivers, and vice versa. However, some drivers expect that all metadata associated with a file be in a "metadata" field. If you're going to be using other languages, it's a good idea to wrap info you might want them to see in a "metadata" field. For example, instead of: <?php $grid->storeFile("somefile.txt", array("date" => new MongoDate())); ?> use something like: <?php $grid->storeFile("somefile.txt", array("metadata" => array("date" => new MongoDate()))); ?> THE MongoGridFS"; FAMILY" MongoGridFS represents the files and chunks collections. MongoGridFS extends MongoCollection, and an instance of MongoGridFS has access to all of MongoCollection methods, which act on the files collection: <?php $grid = $db->getGridFS(); $grid->update(array("filename" => "foo"), $newObj); // update on the files collection ?> Another example of manipulating metadata: <?php // save a file $id = $grid->storeFile("game.tgz"); $game = $grid->findOne(); // add a downloads counter $game->file['downloads'] = 0; $grid->save($game->file); // increment the counter $grid->update(array("_id" => $id), array('$inc' => array("downloads" => 1))); ?> You can also access the chunks collection from an instance of MongoGridFS: <?php $chunks = $grid->chunks; // $chunks is a normal MongoCollection $chunks->insert(array("x" => 4)); ?> There are some methods for MongoGridFS with the same name as MongoCollection methods, that behave slightly differently. For example, Mon- goGridFS.remove(3) will remove any objects that match the criteria from the files collection and their content from the chunks collection. To store something new in GridFS, there are a couple options. If you have a filename, you can say: <?php $grid->storeFile($filename, array("whatever" => "metadata", "you" => "want")); ?> If you have a string of bytes that isn't a file, you can also store that using MongoGridFS.storeBytes(3): <?php $grid->storeBytes($bytes, array("whatever" => "metadata", "you" => "want")); ?> Querying a MongoGridFS collection returns a MongoGridFSCursor, which behaves like a normal MongoCursor except that it returns MongoGridFS- Files instead of associative arrays. MongoGridFSFiles can be written back to disc using MongoGridFSFile.write(3) or retrieved in memory using MongoGridFSFile.getBytes(3). There is currently no method that automatically streams chunks, but it would be fairly easy to write by querying the $grid->chunks collection. MongoGridFSFile objects contain a field file which contains any file metadata. CLASS SYNOPSIS
MongoGridFS extends MongoCollection Fields o public MongoCollection$chunks NULL o protected string$filesName NULL o protected string$chunksName NULL Methods o public MongoGridFS::__construct (MongoDB $db, [string $prefix = "fs"], [mixed $chunks = "fs"]) o public bool MongoGridFS::delete (mixed $id) o public array MongoGridFS::drop (void ) o public MongoGridFSCursor MongoGridFS::find ([array $query = array()], [array $fields = array()]) o public MongoGridFSFile MongoGridFS::findOne ([mixed $query = array()], [mixed $fields = array()]) o public MongoGridFSFile MongoGridFS::get (mixed $id) o public mixed MongoGridFS::put (string $filename, [array $metadata = array()]) o public bool MongoGridFS::remove ([array $criteria = array()], [array $options = array()]) o public mixed MongoGridFS::storeBytes (string $bytes, [array $metadata = array()], [array $options = array()]) o public mixed MongoGridFS::storeFile (string $filename, [array $metadata = array()], [array $options = array()]) o public mixed MongoGridFS::storeUpload (string $name, [array $metadata]) SEE ALSO
oMongoDB core docs on GridFS oLightCube Solutions blog post on saving user uploads oLightCube Solutions blog post on adding metadata to files PHP Documentation Group MONGOGRIDFS(3)
All times are GMT -4. The time now is 11:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy