Find file between timestamps Query


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Find file between timestamps Query
# 1  
Old 05-11-2015
Hammer & Screwdriver Find file between timestamps Query

On my linux box, I have a file say dump.txt.

I then need to move to another seperte folder and need to find only one file with extension *.tar that has the closest timestamp after / next to the timestamp of the dump.txt.
# 2  
Old 05-11-2015
You have 386 posts. Is there an example of something you have tried yourself yet?
These 2 Users Gave Thanks to zaxxon For This Post:
# 3  
Old 05-11-2015
Quote:
Originally Posted by zaxxon
You have 386 posts. Is there an example of something you have tried yourself yet?
Code:
 
ls -l dump.txt --time-style=+"%Y%m%d %H:%M:%S"
-rwxr-x--- 1 dsl siebel 2302 20140902 09:31:24 dump.txt

I do not know how to extract "20140902 09:31:24" & increment the timestamp while matching it with the timestamp of all *.tar files.

I dont even know if this is the right approach.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find matching timestamps in two files.

OK. if the first file is : 3184 2014-07-28 04:15 global.Remote-Access 10.111.8.25 81.245.6.25 tcp 3268 3035 2014-07-28 04:16 global.Remote-Access 10.111.8.12 81.245.6.25 tcp 3268If the second file is: 1 Jul 28 04:12 2014-07-28 id967254(BGC-TLW-Cert) Tunneling: User with IP... (8 Replies)
Discussion started by: fxsme
8 Replies

2. Shell Programming and Scripting

Search lines between two timestamps in a file

Hi, I want to pull lines between two timestamps from a file. When I just insert values directly it is working fine. sed -n '/2014-02-14 05:30/,/2014-02-14 05:31/p' Logfile When I try to insert variable it is not working. sed -n '/TZ=GMT+1 date +%Y-%m-%d" "%H:%M:%S/,/TZ=GMT date... (2 Replies)
Discussion started by: Neethu
2 Replies

3. Shell Programming and Scripting

To search lines between two timestamps in a file

I have a log file where every line starts with a time stamp. I have to extract lines from the file within a given time stamp. For example: IF the file is like this: 2012-08-19 10:34:03,446|WebContainer : 56|OrderHeaderDaoImpl|findByKeys|26| 2012-08-20 11:34:03,463|WebContainer :... (8 Replies)
Discussion started by: abhinalluri
8 Replies

4. Shell Programming and Scripting

Shell Script to execute Oracle query taking input from a file to form query

Hi, I need to query Oracle database for 100 users. I have these 100 users in a file. I need a shell script which would read this User file (one user at a time) & query database. For instance: USER CITY --------- ---------- A CITY_A B CITY_B C ... (2 Replies)
Discussion started by: DevendraG
2 Replies

5. AIX

How to find time difference between 2 timestamps?

HI All, can some one please help me how to fine the difference between two time stamps say a= Nov 10, 2009 9:21:25 AM b= Nov 10, 2009 10:21:25 AM I want to find difference between the a & b I googled and tried with some options but no luck. My OS is AIX (1 Reply)
Discussion started by: bandlan9
1 Replies

6. UNIX for Dummies Questions & Answers

how to find difference of 2 timestamps in secs?

I have a requirement to find the time difference in second between 2 given time stamps. An example scenario is shown below: 30 Oct 11:42:29:992 DEBUG org.apache.commons.digester.Digester - New match='form-validation/global/validator' (IID=, TID=) 30 Oct 11:42:29:993 DEBUG... (0 Replies)
Discussion started by: Alecs
0 Replies

7. Shell Programming and Scripting

File timestamps in different servers.

Hello, I need to gather timestamps and file sizes of all the list of files in different servers. The servers and file locations will be different for each file. I'm thinking of keeping a comman delimited file with {source_server_name,source location, file name} as records in the file. So, I... (1 Reply)
Discussion started by: bperl
1 Replies

8. UNIX for Advanced & Expert Users

mv command and file-timestamps

Hi all, I need help to find out if it is possible (if so, how? :D ) to move a hard link to a given file without making the main file i-node modification time change. That is: I have a file myFile.txt , and I have a link myLink.dat to that file (obtained by: ln myFile.txt myLink.dat).... (1 Reply)
Discussion started by: gian1975
1 Replies

9. UNIX for Dummies Questions & Answers

find command not giving file names accord. to timestamps

Currently iam working on solaris environment, Iam using find command to get list of all files between any two given dates. But the find command is not listing files accord. to timestamp. I tried using -exec option as -exec ls -ltr {} \; Still the files are not listed according to timestamp..... (8 Replies)
Discussion started by: thanuman
8 Replies

10. Shell Programming and Scripting

Find command to get the timestamps

I want to have the timestamps of the files containing a specific string in them. I have tried using different combinations of find command and grep and ls but not giving the desired output. find $HOME/bin/shells -name "*" -print -exec ls -Flt {} -exec grep -i "abc" '{}' \; Please help. (8 Replies)
Discussion started by: nguda
8 Replies
Login or Register to Ask a Question