| commit | cb4f0ca3462af9c2353f85d3bb4836e7bdb03bdc | [log] [tgz] | 
|---|---|---|
| author | Jian Zhang <zhangjian.3032@bytedance.com> | Thu Mar 23 18:18:10 2023 +0800 | 
| committer | Jian Zhang <zhangjian.3032@bytedance.com> | Thu Mar 23 23:24:17 2023 +0800 | 
| tree | 81080d1577967265cf4e9c4de49857200f693925 | |
| parent | 3363f6553b3bd196ee51d05c322e395201a49dad [diff] | 
Fix rsync unexpectly skip file
Normally rsync will skip any files that are already the same size and
have the same modification timestamp. Due to this, if 2 modify event
in one file happen in a short time, the second modify event will be
skipped by rsync.
This patch add a new option `-I` (--ignore-times) to rsync, which
sync file forcely even if the file size and modification timestamp
are the same.
Before this patch:
1. Prepare the file `foo`, content is:
```
123
```
2. Modify the file `foo` twice in a short time.
Note: Don't Change the File Size. I use this cpp code to mock.
```
\#include <fstream>
\#include <thread>
int main() {
  std::ofstream file("foo");
  file << "foo";
  file.close();
  std::this_thread::sleep_for(std::chrono::milliseconds(200));
  std::ofstream file1("foo");
  file1 << "bar";
  file1.close();
  return 0;
}
```
3. Check the syncd file, expect the content is `bar`, but the `foo`
was found.
After this patch the the file `foo` is synced always.
Change-Id: I25799319fed93631aa9d20b5b5efdd7391b585e1
Signed-off-by: Jian Zhang <zhangjian.3032@bytedance.com>
Phosphor BMC Code Management provides a set of system software management applications. More information can be found at Software Architecture
To build this package, do the following steps:
meson buildninja -C buildTo clean the repository run rm -r build.