D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Uploading files - dates

 

On 11/03/11 13:25, Gordon Henderson wrote:
On Fri, 11 Mar 2011, Neil Winchurst wrote:

I have noticed that when I upload any files to my website via FTP that
the original dates of the files do not get copied across. The date
shown is the date of the upload.

Is there any way to have the original dates copied across?

It depends on how you do the copy. Can you use rsync? That has the
ability to preserve timestamps.

I don't think the FTP protocol actually allows changing timestamps.

Do you have shell acces to the remote site? If so, FTP up a TAR file and
unpack it locally... tar has the option of preserving timestamps and
filemodes.

Gordon

I did look at rsync, but in the end I did it differently. So here is one way, but not the only way I am sure.

When you zip a file it keeps permissions and date/time. So I ran a test by zipping a few files. Then I transferred the zip file to my web site using FTP. My site used cPanel as the control panel so I opened that and went to the file manager. There I unzipped the file using the extract option. Then I opened up my FTP program (FireFTP) and had a look at the extracted files. Sure enough the original dates were there.

A bit long winded I know, however I will not need to do it very often. At least now I know one way to keep the original dates when I transfer files across to my web site.

Neil

--
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq