The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Auto copy for files from folder to folder upon instant writing Bashar UNIX for Advanced & Expert Users 2 08-21-2008 11:44 AM
Copy and entire folder except one vibhor_agarwali UNIX for Dummies Questions & Answers 6 10-12-2007 05:02 AM
How to copy file and locate in new folder? cedrichiu Shell Programming and Scripting 3 06-06-2007 10:00 PM
How to copy Folder with FTP heru_90 Shell Programming and Scripting 1 08-22-2006 08:17 PM
copy folder tamemi UNIX for Dummies Questions & Answers 1 04-04-2004 07:29 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 05-23-2008
Registered User
 

Join Date: May 2008
Posts: 14
Post Copy the latest file from a folder

Hi,

I have a problem.

I have some text files in a folder. The names can be like:

emp_20080307053015.dat
emp_20080306053015.dat
emp_20080305053015.dat
emp_20080304053015.dat

The date format appended is like yyyymmdd and timestamp.

What i need is i have to copy the latest file every day i.e. which has the latestdate appended to the file name to a different folder.


Can any one tell a shell script for this?


Thanks in advance....
Forum Sponsor
  #2  
Old 05-23-2008
Registered User
 

Join Date: Mar 2008
Location: /bin/sh
Posts: 352
Are you depending on the timestamp also to find out the latest file. If that is the case,

Code:
ll -ltr | tail -1
  #3  
Old 05-23-2008
Registered User
 

Join Date: May 2008
Posts: 14
Post Copy the latest file from a folder

Yes I need to check the timestamp also.
so can you please send me the script to pick the latest file everyday.

thanks
  #4  
Old 05-23-2008
DukeNuke2's Avatar
Soulman
 

Join Date: Jul 2006
Location: Germany, Berlin
Posts: 1,487
do not crosspost and don't let others do YOUR work! thread closed...
Google The UNIX and Linux Forums
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 07:41 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0