Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FTP to two places in a server..

Status
Not open for further replies.

kumariaru

IS-IT--Management
Mar 9, 2006
61
AU
Good Morning..
I have 100 files to be ftp from one serverA to two places(ServerB).
I am getting files in this format "FILE_12/23/2006.txt", (files are getting with date in them).
While moving the file to one folderA I have to rename the file by removing the date part and straight move to other folderB.
After successfull transfer of the files I have to deletes files transfered from ServerA.
Next part is I have to check for files in FolderB(ServerB),files which exceed more then 90 days has to get deleted.( ex: 12/23/2006+90 > current then delete the file).
I need to pull the date from the file.. How can I work this logic in a script.....
I am bad at the shell scripting..Any help is really great..
Thanks in advance,
Kumari..
 
"FILE_12/23/2006.txt"
I can't believe you've got any file with such name ...
 
So folderA and folderB are both on ServerB, correct?

Do you have access to both ServerA and ServerB?

As far as I know there is no way to copy files remotely via FTP, so you will have to transfer the files twice.

The easiest way to remove the old files would be to run a separate job on ServerB using the find command to identify and remove files that are more than 90 days old, because date calculations can be quite difficult in shell scripting.

Let us know what you have tried so far and we can try and help.

Annihilannic.
 
Which version of Unix?

Sound a bit like homework to me btw!

Mike

"Whenever I dwell for any length of time on my own shortcomings, they gradually begin to seem mild, harmless, rather engaging little things, not at all like the staring defects in other people's characters."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top