Hi: I really want to know how rsync works. Once it synchronize a file. Does rscync first create a temporary in the remote machine first and then rename it? Or it direct write the difference into the dest-file? Could you please tell me what will happen to the dest-file when a rsync process interrupted by some problems(network problem etc ...)? Thanks for your help Best Regards *********************************** Du Yang Nortelnetworks RND1 * +86-010-65108342 (ESN)542-8342 * yangdu@nortelnetworks.com ***********************************
That is it. The destination file is unaffected until rsync completes its replacement, then the directory entry is repointed at the new file and the reference to the old inode freed. Tim Conway Unix System Administration Contractor - IBM Global Services desk:3032734776 conway@us.ibm.com Hi: I really want to know how rsync works. Once it synchronize a file. Does rscync first create a temporary in the remote machine first and then rename it? Or it direct write the difference into the dest-file? Could you please tell me what will happen to the dest-file when a rsync process interrupted by some problems(network problem etc ...)?
> Once synchronize a file. Does rscync first create a temporary in the > remote machine first and then rename it? Or it direct write the difference > into the dest-file? > > Could you please tell me what will happen to the dest-file when a rsync > process interrupted by some problems(network problem etc ...)? > > Thanks for your help > > Best Regards > > *********************************** > Du Yang > Nortelnetworks RND1 > * +86-010-65108342 (ESN)542-8342 > * yangdu@nortelnetworks.com > *********************************** >
hello, I am a student in China.I like the linux and usually use the rsync to backup my documents. Last week when I use it,I find a question I want to discuss with you. The condition is like this: The source file that I want to rsync to another computer is 129M before I start the rsync. During the running of the rsync,the file was changed and became to about 50M, then the rsync ended. When I view the destination, I found that the file was 129M. And there were some contents of the files added when the rsync was running. After that, I do some tests about the rsync: 1. After I start the rsync to backup a file, I delete the file during the rsync is running, I found the file can been backuped normally. 2. While the rsync is backuping a file name sourfile (50M), I add some content by the command "cat addfile >> sourfile" to enlarge the file to 100M. After the rsync finished.I found the file is still 50M. The question is that , how the rsync copy a file to another computer at the first time ? My attitude is that it remenbers the physical blocks the file used when the rsync scaned. Then ,rsync will send the blocks to the destination no matter if the file or the block has changed. So, is that right?? Who can tell me how the rsync decide which contents should to send to the destiation? Sorry, my English is very poor. Thanks for your read and answer!! _________________________________________________________________ ÓëÁª»úµÄÅóÓѽøÐн»Á÷£¬ÇëʹÓà MSN Messenger: http://messenger.msn.com/cn
Thanks for your answer! Yes,my question is that if we can get a good result when the file is changing while it is being copied by rsync In my test, if the file is being augmented while it been copied using rsync.I can get a normal copy on the other end and the result file is the same as what the source file is when the rsync scanning. The same result can be gotten if the sour file is reduced and the blocks were not occupied. As you said, if the source file reduced and the blocks were occupied by other files there will be a file with other file's content and a abnormal end on the other end. So,is this true that we can't deal with this problem except to do some changes with the OS ? Regards, GuoJing> > The condition is like this: The source file that I want to rsync to > > another computer is 129M before I start the rsync. During the runningof> > the rsync,the file was changed and became to about 50M, then the rsync > > ended. When I view the destination, I found that the file was 129M. And > > there were some contents of the files added when the rsync was running. > > > > After that, I do some tests about the rsync: > > > > 1. After I start the rsync to backup a file, I delete the file > > during the rsync is running, I found the file can been backupednormally.> > 2. While the rsync is backuping a file name sourfile (50M), I add > > some content by the command "cat addfile >> sourfile" to enlarge thefile> > to 100M. After the rsync finished.I found the file is still 50M. > > > > The question is that , how the rsync copy a file to another computerat> > the first time ? My attitude is that it remenbers the physical blocksthe> > file used when the rsync scaned. Then ,rsync will send the blocks tothe> > destination no matter if the file or the block has changed. So, is that > > right?? Who can tell me how the rsync decide which contents should tosend> > to the destiation? > >I'm not sure I understand the question, sorry. > >If you change a file while it is being copied by rsync you may end up >with undefined results on the other end. There is not much that can >be done about this without os-level version control. >_________________________________________________________________ ÓëÁª»úµÄÅóÓѽøÐн»Á÷£¬ÇëʹÓà MSN Messenger: http://messenger.msn.com/cn