Ftp – Need to make all the timestamps on local files match their corresponding ftp hosted file’s timestamp

ftpsynchronizationtimestampwimax

I screwed up and downloaded ~10GB worth of files from my offsite backup location (ftp server) without checking the 'preserve timestamp' option in the client.

The PC with the local files is a netbook that uses a WiMax (4G cellular) connection for internet access, and the operation used up all my monthly bandwidth, plus $250 in additional bandwidth.

I'm having a problem with the app that updates the mirrored copy on the ftp server, in that it thinks everything's new now since all the files have the same timestamp, and appear to be newer than the copies on the server. It wants to upload everything all over again, which isn't an acceptable option.

Aside from downloading all ~10GB again, I'm seeking a way to transfer the timestamps from the ftp hosted files to their corresponding local file. Does anyone know a way to do that?

Another issue I'm concerned about is that some of the files that exist in both locations have changed, and if I change all the timestamps without considering this, I'm afraid some won't get mirrored later. In addition to changing all the timestamps, I'm going to need a way to compare the differences between the files in each location, and update the server's files according to a hash or something. Luckily, the ftp server does support hashing. I'm not aware of which client that can do what I need it to do to do that. Could someone also reccomend a client to do that?

Thanks in advance.

UPDATE:

I posted a similar message on the ftp client's forums, and got a reply advising me to restart the entire transfer all over again, and when the client asks what to do about files that already exist locally, to set it to 'resume' the file transfer.

The operation is currently doing its thing quite happily, and since now the client is set to preserve the timestamps, it's changing them all to the timestamp on the server like I need.

Best Answer

I just made the same mistake; downloaded many files without preserving timestamp. While the author found a solution, he does not state which FTP client he used.

The following solution will update timestamp for files (labeled as "date modified" in Microsoft Windows) available via FTP with FileZilla Client. I have not found a solution to synchronizing the folder timestamp.

Using FileZilla 3.7.3
1. Turn on preserve timestamp: Transfer > Preserve Timestamp ...
2. Turn on resume transfers: Transfer > Default file exists action...
3. and then, Downloads: Resume file transfer (or set Uploads if timestamp error is in the other direction)
4. Re-initiate the download. Existing, completed files will have their timestamp updated.

Note: FTP is a relatively simple protocol, so a recursive listing will be re-issued on each directory on the remote FTP server. This will take some time for a server with many files and directories.

If your server is SFTP, you can use WinSCP to synchronize timestamps.
1. Navigate to the proper directories
2. Commands > Sychronize
3. If you are connected to an SFTP server, you will see an option to Sychronize Timestamps under "mode"
See, https://winscp.net/eng/docs/task_synchronize_full#mode