The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to manage the .nfs files generated by the system dowell Filesystems, Disks and Memory 0 06-06-2008 10:25 AM
How to list all the files which are not generated today redlotus72 UNIX for Dummies Questions & Answers 2 10-05-2007 06:27 AM
get the last generated log file ragha81 Shell Programming and Scripting 8 12-19-2006 08:02 AM
generated CSV file on AIX mpang_ Shell Programming and Scripting 0 09-05-2006 08:01 PM
Core File Not Being Generated in AIX S.P.Prasad High Level Programming 6 09-23-2003 02:40 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 12-22-2007
Registered User
 

Join Date: Nov 2007
Posts: 15
Ftp all the generated files

Hi All,

I'm working on a ftp shell script in which I'm tranfering files from one sever to another using ftp.

Some program generates files at undefined time & throughout the day.
I have to transfer the files time to time.. i.e. once the file is generated, it should be transfered at the very moment or as early as possible.

If I write a script to transfer the latest file & schedule it wth maximum frequecy, say 3 mins/4 mins , then it'll be unnecessarily overwrite the files again and again.. even the question remains wht if there are 2 files generated in 3 mins.. only the latest file will get transfer.

Wht should be done to tackle with this..
Any suggestions?

Thanks in advance.

Regards,
im_new
Reply With Quote
Forum Sponsor
  #2  
Old 12-22-2007
Registered User
 

Join Date: Sep 2006
Posts: 1,580
you only want to transfer the latest file?
one way
1) create a dummy file
2) use the find command and the -newer option. check the man page of find
3) if its newer, transfer the file
4) update the dummy file with the time stamp of that latest file
5) and so on
Reply With Quote
  #3  
Old 12-22-2007
Registered User
 

Join Date: Nov 2007
Posts: 15
Thanks for the suggestion..
Actually the files are having format as- unique'timestamp'.rtf e.g
UNIQUE20071219030529.rtf

& the filename changes as per the timestamp.
Hw can I keep track of these files?
Reply With Quote
  #4  
Old 12-22-2007
Registered User
 

Join Date: Sep 2006
Posts: 1,580
Quote:
Originally Posted by im_new View Post
Thanks for the suggestion..
Actually the files are having format as- unique'timestamp'.rtf e.g
UNIQUE20071219030529.rtf

& the filename changes as per the timestamp.
Hw can I keep track of these files?
it doesn't matter, as the file is created, it will have an OS time stamp. Use the OS time stamp should be ok.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 07:25 AM.


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