1850870 Members
3016 Online
104056 Solutions
New Discussion

FTP

 
Jade Bulante
Frequent Advisor

FTP

We have a job that runs every night on a VAX system and it generates several reports. These reports all have the same naming convention except that the dates are different.

I will be running a cron job on a HPUX system that will grab all this files daily. Is there any parameters within FTP that I can get only the newest report generated from the VAX system? If not what I can do to streamline the process?
4 REPLIES 4
Stefan Farrelly
Honored Contributor

Re: FTP


You want to use the 'newer' option in ftp to get your files - it will only get them if theyre new or if theyve been modified more recently. See man on ftp and search for info on the newer command.
Im from Palmerston North, New Zealand, but somehow ended up in London...
James R. Ferguson
Acclaimed Contributor

Re: FTP

Hi Jade:

There is an option for 'ftp' that addresses this. The 'newer filename' command will get a file only if the modification time of the remote file is more recent that the file on the current system. This does not always work on all operating systems, but is worth a try.

See the 'ftp' man pages for more information.

Regards!

...JRF...
Martin Johnson
Honored Contributor

Re: FTP

It is not clear on what you are trying to do. Are you saying that the date is part of the file name?

If not, the latest version of the file on the VAX can be checked with the latest version on the HPUX with the "newer" command in ftp. A get is done only when the file on the VAX is newer than the one on the HPUX system.

HTH
Marty
Rich Wright
Trusted Contributor

Re: FTP

You may need to use two ftp sessions in you script. The first to capture "dir" output. The second to get the file based on the captured information.