The easiest way to restore timestamps of files?

Frantisek Hanzlik franta at hanzlici.cz
Wed Apr 29 06:23:56 MDT 2015


Kevin Korb wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> - --archive --itemize-changes --size-only --dry-run
> Obviously the last one is so you can confirm what it is going to do.
> 
> On 04/26/2015 06:08 PM, Frantisek Hanzlik wrote:
>> Please, is possible (with rsync) re-create files timestamps? I mean
>> something like choosing a "-T" in the program mirror- from it's man
>> page e.g. there: 
>> http://sunsite.univie.ac.at/textbooks/mirror/mirror.html#Flags
>>
>> "Do not do any file transfers just force the time-stamps of any
>> local files to be reset to be the same as the remote files.
>> Normally only used when initialising a mirror that already contains
>> files retrieved another way (e.g. from CDROM)."
>>
>> This is the situation I have encountered several times - I have
>> local files which was downloaded from internet archive via FTP or
>> obtained somehow, these files have bad timestamp, and now I want
>> use rsync for their synchronization with the remote rsync server
>> and also correct their bad timestamp - of course without
>> re-downloading. Is it possible?

Hi Kevin,
thanks for your help, it works. My mistake was that I thought that
the use of the '--size-only' switch will not repair file timestamps.

Now I still do not understand why does not work this switch form:

--chmod=D=775,F=664

(it causes error message:
rsync: Invalid argument passed to --chmod (D=775,F=664)
rsync error: syntax or usage error (code 1) at main.c(1554) [client=3.1.0]
). But it isn't too big problem, as form:

--chmod=Dug=rwx,Do=rx,Fug=rw,Fo=r

works well. It seems as compatibility with chmod syntax isn't perfect
and rsync man page not clearly mentioned this.

Thanks again, Franta Hanzlik



More information about the rsync mailing list