How do I transfer just the modification times with rsync? I now the file content is the same but the modification times are different. Is there a way to do this? Every way that I have tried causes the whole file to transfer as well. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.samba.org/pipermail/rsync/attachments/20170407/075895fb/attachment.html>
If you are sure the content is correct you can run rsync with both --times and --size-only. This will cause rsync to "fix" the timestamps on files that are the same size on both ends. On 04/07/2017 02:53 PM, McDowell, Blake via rsync wrote:> How do I transfer just the modification times with rsync? I now the file > content is the same but the modification times are different. Is there a > way to do this? Every way that I have tried causes the whole file to > transfer as well. > > Thanks > >-- ~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._., Kevin Korb Phone: (407) 252-6853 Systems Administrator Internet: FutureQuest, Inc. Kevin at FutureQuest.net (work) Orlando, Florida kmk at sanitarium.net (personal) Web page: http://www.sanitarium.net/ PGP public key available on web site. ~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._., -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 224 bytes Desc: OpenPGP digital signature URL: <http://lists.samba.org/pipermail/rsync/attachments/20170407/a7177c17/signature.sig>
I guess I should also mention that if both trees are local you can use: find . -print -exec touch "/path/to/wrong/times/{}" --reference "{}" \; On 04/07/2017 02:58 PM, Kevin Korb via rsync wrote:> If you are sure the content is correct you can run rsync with both > --times and --size-only. > > This will cause rsync to "fix" the timestamps on files that are the same > size on both ends. > > On 04/07/2017 02:53 PM, McDowell, Blake via rsync wrote: >> How do I transfer just the modification times with rsync? I now the file >> content is the same but the modification times are different. Is there a >> way to do this? Every way that I have tried causes the whole file to >> transfer as well. >> >> Thanks >> >> > > >-- ~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._., Kevin Korb Phone: (407) 252-6853 Systems Administrator Internet: FutureQuest, Inc. Kevin at FutureQuest.net (work) Orlando, Florida kmk at sanitarium.net (personal) Web page: http://www.sanitarium.net/ PGP public key available on web site. ~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._., -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 224 bytes Desc: OpenPGP digital signature URL: <http://lists.samba.org/pipermail/rsync/attachments/20170407/b4027f4f/signature.sig>
Thank you! I run --times when I use rsync (I actually use the -a flag) but the times do not transfer over and if I run rsync dryrun with -i I can see that it wants to transfer the files because of times. When I run rsync a second time with your suggestion the times do transfer over. I don't know why... B ________________________________________ From: rsync [rsync-bounces at lists.samba.org] on behalf of Kevin Korb via rsync [rsync at lists.samba.org] Sent: Friday, April 07, 2017 2:58 PM To: rsync at lists.samba.org Subject: Re: modification times questions If you are sure the content is correct you can run rsync with both --times and --size-only. This will cause rsync to "fix" the timestamps on files that are the same size on both ends. On 04/07/2017 02:53 PM, McDowell, Blake via rsync wrote:> How do I transfer just the modification times with rsync? I now the file > content is the same but the modification times are different. Is there a > way to do this? Every way that I have tried causes the whole file to > transfer as well. > > Thanks > >-- ~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._., Kevin Korb Phone: (407) 252-6853 Systems Administrator Internet: FutureQuest, Inc. Kevin at FutureQuest.net (work) Orlando, Florida kmk at sanitarium.net (personal) Web page: http://www.sanitarium.net/ PGP public key available on web site. ~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,