06-07-2011
copy files based on creation timestamp
HI friernds..
i want to re-phrase my query
I have the below listing of files under a directory [$DIR] in unix
-rw-r--r-- 1 abc abc 263349631 Jun 1 11:18 CDLD_201155.xml
-rw-r--r-- 1 abc abc 267918241 Jun 1 11:21 CDLD_201161.xml
-rw-r--r-- 1 abc abc 257672513 Jun 3 10:41 CDLD_201143.xml
-rw-r--r-- 1 abc abc 290436512 Jun 3 10:41 CDLD_201130.xml
-rw-r--r-- 1 abc abc 276825093 Jun 3 10:41 CDLD_201152.xml
Please advice on a command in unix by which I can copy only June 3 created files [and not June 1] into another directory [$DIR/Temp]
Note that I donot want to copy based on date information appearing in file name [exa: 201155] , rather I want to copy based on date when it was created
Please advice here
REgards,
Suresh
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Howdy,
I'm trying to figure out how to move multiple files based on their creation date. If anyone can enlighten me it would be most appreciated!!
Thanks!
:D (1 Reply)
Discussion started by: dgoyea
1 Replies
2. UNIX for Advanced & Expert Users
how to copy lines from a log file based on timestamp.
INFO (RbrProcessFlifoEventSessionEJB.java:processFlight:274) - E_20080521_110754_967: rbrAciInfoObjects listing complete!
INFO (RbrPnrProcessEventSessionEJB.java:processFlight:197) - Event Seq: 1647575217; Carrier: UA; Flt#: 0106; Origin:... (1 Reply)
Discussion started by: ranjiadmin
1 Replies
3. Shell Programming and Scripting
Hi All,
I have a directory which has crores of files since from 2003 till now. I want to move only the 2003 files to another directory. Please help.
Thanks (2 Replies)
Discussion started by: IHK
2 Replies
4. Shell Programming and Scripting
I am sorry to repost this question. it was not clear, and I had the meeting and didn't response the question on time. I do really need help and appreciate your help very much.
I'm looking for a simple shell script that will read lots of audit log file (*.aud) in a log fold every 10 minutes,... (1 Reply)
Discussion started by: percvs88
1 Replies
5. Shell Programming and Scripting
I'm looking for a command or simple script that will read lots of audit log file (*.aud) in log fold every 10 minutes, and will output to one file based on sysdate - 10 minutes. assume the script is run at 11:12:20, and it
should grep the line from Wed Jun 17 11:02:43 2009 to end of file. after... (4 Replies)
Discussion started by: percvs88
4 Replies
6. Shell Programming and Scripting
Hi
I have a requirement like below
I need to sort the files based on the timestamp in the file name and run them in sorted order and then archive all the files which are one day old to temp directory
My files looks like this
PGABOLTXML1D_201108121235.xml... (1 Reply)
Discussion started by: saidutta123
1 Replies
7. Shell Programming and Scripting
Please help me with a command to find all files in directory and copy them into another with a timestamp. I have
the code to find and copy the files but unable to add timestamp to the files.
Below is the find and copy code which i am using(need to add timestamp)
find /root/files -name "*.gz"... (8 Replies)
Discussion started by: vel4ever
8 Replies
8. Shell Programming and Scripting
Hi,
I have a directory having so many number of files. Now I want to move the files which are older than one month (lets say) from this directory to another directory (say BKP dir).
Simply, if file is olderthan one month move it from source1 dir to BKP1 dir.
My file names doesn't have... (7 Replies)
Discussion started by: karumudi7
7 Replies
9. UNIX for Dummies Questions & Answers
Hi,
I have requirement to list out files that are created after particular file.
ex. I have below files in my directory. I want to display files created after /dirdat/CG1/cg004440 file.
./dirdat/CG1/cg004438 09/07/14 0:44:05
./dirdat/CG1/cg004439 09/07/14 6:01:48 ... (3 Replies)
Discussion started by: tmalik79
3 Replies
10. UNIX for Beginners Questions & Answers
Hi everyone :-)
I ran into a small issue. I would like to copy some files in the precise order they were created.
So the oldest files should be copied first and the newest ones last.
I tried cp -r $(ls -1t) ./destination but the files are still not sorted properly. I was thinking, that... (11 Replies)
Discussion started by: officiallyme
11 Replies
LEARN ABOUT HPUX
show_link
show link(1m) show link(1m)
NAME
show link - Displays attribute information about the specified soft link
SYNOPSIS
cdscp show link link-name [attribute-name] [with attribute-name = attribute-value]
ARGUMENTS
The full name of a specific soft link. The last simple name can contain wildcard characters. The name of a particular attribute; see
Description for valid attribute names. The value of a particular attribute.
DESCRIPTION
The show link command displays the names and values of the attributes specified in attribute-name. You can use a combination of attributes
in any sequence in a single command. Use a space to separate multiple attributes. You can use a with attribute-name = attribute-value
clause to limit output only to soft links whose attributes have values equal to the specified values. A space must precede and follow the
= (equals sign). If you do not supply any attributes, the command displays all attributes and their values. The following is a description
of soft link attributes: Specifies the creation timestamp (CTS) of this soft link Specifies the full name of the directory, object entry,
or other soft link to which the soft link points Specifies a timeout value after which the soft link is either checked or deleted Specifies
the timestamp of the most recent update to an attribute of the soft link
Privilege Required
You must have read permission to the soft link. If you specify a wildcard soft link name, you also need read permission to the directory
that stores the soft link.
NOTE
This command is replaced at Revision 1.1 by the dcecp command and may not be provided in future releases of DCE.
EXAMPLE
The following command displays the current values of all the attributes associated with the soft link /.:/sales/region1. cdscp> show link
/.:/sales/region1
SHOW
SOFTLINK /.../abc.com/sales/region1
AT 1991-10-15-15:54:40
CDS_CTS = 1991-10-15-19:54:35.00000003/08-00-2b-1c-8f-1f
CDS_UTS = 1991-10-15-19:54:35.00000006/08-00-2b-1c-8f-1f
CDS_LinkTarget = /.../abc.com/sales/service
SHOW
SOFTLINK /.../abc.com/sales/region1
AT 1991-10-15-15:54:41
CDS_CTS = 1991-10-15-19:54:36.00000077/08-00-2b-1c-8f-1f
CDS_UTS = 1991-10-15-19:54:36.00000009/08-00-2b-1c-8f-1f
CDS_LinkTarget = /.../abc.com/sales/software
CDS_LinkTimeout = :
Expiration = 1991-10-15-00:00:00.0
Extension = +1-00:00:00.000
RELATED INFORMATION
Commands: create link(1m), delete link(1m), list link(1m), remove link(1m), set link(1m)
show link(1m)