Skip to content
Advertisement

Compare time-stamp of a remote file with a local file using Ant

I have an installer file on my remote machine with Installer-000.zip name and i want to copy that file into my local machine(linux-CentOS) under /media/Data/Installer/ directory using ant ftp task.

I am able to copy the installer from remote server to my machine if the installer is not already present in my machine but when i again run the build.xml it downloads the heavy installer file again on my local machine which makes the whole building time much longer.

so esentially i want to comapre the time-stamp of my installer(remote) with one on my local machine and copy from remote to local if the installer file present on remote machine has a newer time-stamp.

(Obviously I want an ant task to do this. I am using ant-version 1.9.6 )

any suggestion or comments would be appreciated !

Thanks in advance !

Advertisement

Answer

I don’t think there is an ANT task that will calculate the checksum of a remote file. I suggest a different approach of using rsync over ssh.

Ant, download fileset from remote machine

Advertisement