Robert Scholten
2002-Apr-04 23:37 UTC
is it a bug or a feature? re:time zone differences, laptops, and suggestion for a new option
>Dear Tim, Martin,Thanks for helping with this. I tried setting TZ=UTC at both ends, and discovered that for some reason the files had a 1-hour timestamp difference. Not sure how that happened, but clearly not an rsync problem. I have added a note on this to my web page for PC users (http://optics.ph.unimelb.edu.au/help/rsync/rsync_pc1.html): rsync tries to convert all file timestamps into UTC at both ends. If seemingly identical files with the same timestamp seem to be transferring, try this at both ends: export TZ=UTC ls -l --full-time file_in_question If the remote and local files have the same timestamp, and they're still transferring, then you have a different problem. BTW, I have recently found another problem with using rsync on Windows/cygwin platforms. I had an exclude/include file list in dos format (cr/lf pairs instead of newlines). Oh boy did that create some fun. include/exclude rules are funny enough without the weird behaviour of matching added CR's. In my rsync scripts I now run dos2ux on these lists before executing rsync. Thanks again for your help. I live and breathe by rsync now that I'm 20,000km from hom. Rob.>Robert Scholten <r.scholten@physics.unimelb.edu.au> >Sent by: rsync-admin@lists.samba.org >04/04/2002 04:14 AM > > > To: rsync users <rsync@lists.samba.org> > cc: (bcc: Tim Conway/LMT/SC/PHILIPS) > Subject: is it a bug or a feature? re:time zone > differences, laptops, and >suggestion for a new option > Classification: > > > > > >Hi, > >I am using rsync to back up some files from a WinXP laptop to a Linux >server. The two machines are in different time zones (8 hour >separation). It seems that rsync wants to do a full checksum on every >file >because it thinks their time stamps are different. > >Example: > GMT is 9am, Local time (Netherlands) 10am, remote time >(Australia) 8pm > >In this case, the file was created and copied to both machines with the >same timestamp (e.g. 8pm) when both machines were in the same timezone >(Australia). Then I changed countries with my laptop, and ran >rsync. After rsync, the remote (Linux) file has a new timestamp which 8 >hours earlier (e.g. 10am). > >I guess that in some sense, rsync "thinks" they were created at different >universal times, and after rsyncing, they are matched to the same UTC. > >This is OK after I have done it once, but would it be possible to tell >rsync that if the timestamp difference is the same as the current time >difference, it should ignore? Or just change the timestamp rather than >doing a full checksum? I could write a script to run on the Linux box, to > >change the timestamps by the 8-hour time diff, and revert when I return to > >Australia, but surely this happens regularly to other people with laptops? > >Or am I totally confused? > >Any help will be appreciated. >Thanks, >Rob. > > > >-- >Robert Scholten >Eindhoven University of Technology >Physics Department, building N-laag room g2.02 >P.O. Box 513, 5600 MB Eindhoven >The Netherlands > >Tel: +31 40 247 4242 >Mobile: +31 611 430 467 >Fax: +31 40 245 6050 > >email: r.scholten@physics.unimelb.edu.au >http://www.ph.unimelb.edu.au/~scholten > > > >-- >To unsubscribe or change options: >http://lists.samba.org/mailman/listinfo/rsync >Before posting, read: http://www.tuxedo.org/~esr/faqs/smart-questions.html-- Robert Scholten Eindhoven University of Technology Physics Department, building N-laag room g2.02 P.O. Box 513, 5600 MB Eindhoven The Netherlands Tel: +31 40 247 4242 Mobile: +31 611 430 467 Fax: +31 40 245 6050 email: r.scholten@physics.unimelb.edu.au http://www.ph.unimelb.edu.au/~scholten
tim.conway@philips.com
2002-Apr-05 10:23 UTC
is it a bug or a feature? re:time zone differences, laptops, and suggestion for a new option
It's much easier than that. The linux box keeps time in GMT, and displays it in the configured time zone. Try this, on the linux box: "touch testfile ls -l testfile TZ=EST5 export TZ ls -l testfile" You will see the displayed time change, because it's being translated from epoch time (that's what I call it, anyway) - seconds since midnight, January 1, 1970. Your windows box is probably configured to keep and display time in local time. Change it to "hardware clock is in GMT" or whatever it is. The other potential kicker is that ms keeps time in 2-second granularity, or at least, it did in some iterations, hence the "--modify-window=N" option, which lets you say that any time within N seconds is a match. You probably don't need that one, though. Tim Conway tim.conway@philips.com 303.682.4917 Philips Semiconductor - Longmont TC 1880 Industrial Circle, Suite D Longmont, CO 80501 Available via SameTime Connect within Philips, n9hmg on AIM perl -e 'print pack(nnnnnnnnnnnn, 19061,29556,8289,28271,29800,25970,8304,25970,27680,26721,25451,25970), ".\n" ' "There are some who call me.... Tim?" Robert Scholten <r.scholten@physics.unimelb.edu.au> Sent by: rsync-admin@lists.samba.org 04/04/2002 04:14 AM To: rsync users <rsync@lists.samba.org> cc: (bcc: Tim Conway/LMT/SC/PHILIPS) Subject: is it a bug or a feature? re:time zone differences, laptops, and suggestion for a new option Classification:>Hi,I am using rsync to back up some files from a WinXP laptop to a Linux server. The two machines are in different time zones (8 hour separation). It seems that rsync wants to do a full checksum on every file because it thinks their time stamps are different. Example: GMT is 9am, Local time (Netherlands) 10am, remote time (Australia) 8pm In this case, the file was created and copied to both machines with the same timestamp (e.g. 8pm) when both machines were in the same timezone (Australia). Then I changed countries with my laptop, and ran rsync. After rsync, the remote (Linux) file has a new timestamp which 8 hours earlier (e.g. 10am). I guess that in some sense, rsync "thinks" they were created at different universal times, and after rsyncing, they are matched to the same UTC. This is OK after I have done it once, but would it be possible to tell rsync that if the timestamp difference is the same as the current time difference, it should ignore? Or just change the timestamp rather than doing a full checksum? I could write a script to run on the Linux box, to change the timestamps by the 8-hour time diff, and revert when I return to Australia, but surely this happens regularly to other people with laptops? Or am I totally confused? Any help will be appreciated. Thanks, Rob. -- Robert Scholten Eindhoven University of Technology Physics Department, building N-laag room g2.02 P.O. Box 513, 5600 MB Eindhoven The Netherlands Tel: +31 40 247 4242 Mobile: +31 611 430 467 Fax: +31 40 245 6050 email: r.scholten@physics.unimelb.edu.au http://www.ph.unimelb.edu.au/~scholten -- To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.tuxedo.org/~esr/faqs/smart-questions.html