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 Question

Status
Not open for further replies.

ianicr

IS-IT--Management
Nov 4, 2003
230
GB
I've got an ftp script that sends a file overnight. I also need it to receive a file from the same location. The only problem I have is that I do not want to overwrite local files. As in if the file exists don't download it. Is there an easy way to do this?
 
Get the ftp to transfer (both ways) from a particular directory. Keep all other files out of the way by moving them somewhere else with your script

Alex
 
I've got no problem with the receiving of files. The problem I have is that the ftp server is a windows box and I don't have access to it. Is there a way to move files in ftp? Can i move a file once its been downloaded into another directory?
 
In the man ftp page take a look at the newer command.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
ianicr depends on the OS - I use AIX so can only rename, I don't have a newer like PHV. Can't your script do the moving?

Alex

 
PHV. The newer command doesn't work because the file name changed every night.. eg.
test.400.20040301.dat
test.401.20040302.dat

these files stay in the same place on the server.
This is not constant can i not use newer like an mget for multiple files?

If I did the moving in the script wouldn't that just move the local files?
 
You can consider a first ftp session to get a list of files (command dir), analyze in your shell script the listing vs the local files you have get so far and then a second ftp session to get only the files you're interested in.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top