You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/packages/sync-fs/README.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ The code here helps with periodically syncing a compute server and the project,
10
10
where the compute server uses unionfs\-fuse combined with websocketfs, and the
11
11
project uses a non\-FUSE fast local filesystem \(e.g., ext4 or zfs\). This
12
12
algorithm will result in the file systems being equal if there is no activity for
13
-
a few seconds. ItϨ's meant to provide a "last on to change the path wins", BUT
13
+
a few seconds. It's meant to provide a "last one to change the file wins", BUT
14
14
with a tolerance of maybe ~10 seconds, especially for deletes.
15
15
16
16
This does not use inotify or any other file watching because cocalc runs on
@@ -22,6 +22,9 @@ tree is way too much. Instead, when doing sync, we will just walk the tree.
22
22
Running 'find' as a subcommand seems optimal, taking a few KB memory and about
23
23
1s for several hundred thousand files.
24
24
25
+
26
+
- TODO: This sync protocol does NOT deal with file permissions, e.g., changing a file to be executable when it wasn't, since that doesn't update the mtime. See https://github.com/sagemathinc/cocalc/issues/7342
27
+
25
28
## ALGORITHM
26
29
27
30
The actual sync works as follows. For now, we will do this periodically, possibly triggered
@@ -128,3 +131,5 @@ OK, so our protocol instead is that if the time is off by at least 10s \(say\),
128
131
129
132
- mtime versus ctime. We do not use ctime at all. We do use mtime, but it is used to decide in which direction to sync files when there is a conflict. It is NOT used as a threshold for whether or not to copy files at all. E.g., if you have an old file `a.c` and type `cp -a a.c a2.c` on the compute server, then `a2.c` does still get copied back to the project.
130
133
134
+
- mtime versus ctime, part 2: To quote the internet: "You cannot change the ctime by ordinary means. This is by design: the ctime is always updated to the current when you change any of the file's metadata, and there is no way to impose a different ctime." -- https://unix.stackexchange.com/questions/36021/how-can-i-change-change-date-of-file/36105#36105
0 commit comments