Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What happens when the file changes during file replication?

2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

I did an experiment where if the file itself is changing during the copying process, what process should the file be in after the final copy?

Is it the state at the start of replication, the state at the end of replication, or some state of an intermediate file.

Use the script file.sh to insert lines continuously into the file.dmp file, and the file will always grow larger.

file.sh:

Click here to fold or open

#!/ bin/bashi=1while truedoi=$[i+1]echo $i >> file.dmpdone

Break script.

The last line of file.dmp is 152940.

We copy using $ cp file.dmp file.dmp.bak and immediately run the file.sh script to insert the line.

After cp command ends (file must be large enough, otherwise time is very fast, can not be effective), look at the last line of file.dmp.bak file, found that is 152940.

The conclusion is that the files generated by replication will be consistent with the state at the beginning of replication, and the source files will continue to change during the replication process.

Also verify that using rsync works the same.

I welcome your testimonies.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report