This repository was archived by the owner on May 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathprotocol.txt
More file actions
123 lines (95 loc) · 2.13 KB
/
protocol.txt
File metadata and controls
123 lines (95 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
Protocol description (v1)
====================
dmsync uses a simple protocol between the "master" and "slave" mode. This allows
us to pipe it over ssh.
If master sees a:
ERROR <message>
It should display it on stderr and abort.
If master sees a:
WARNING <message>
it should print it to stderr and continue
Handshake
---------
master sends: "HELLO dmsync 1\n"
slave replies:
"HELLO"
Time adjustmenet
----------------
master sends:
"GETTIME\n"
slave replies:
"GETTIME 1203342491\n"
(or error)
master can now calculate timedifference
Find newest timestamp
---------------------
master sends:
"SCAN /tmp\n"
slave replies:
"SCAN 1203342491\n"
Find files/dirs newer than ts
-----------------------------
master sends:
"NEWERTHAN <ts> <dir>\n"
slave replies:
"DIR "..
"FILE "..
"SLNK "..
"HLNK "..
"END"
Creating a directory
--------------------
master sends:
"MKDIR permission atime ctime mtime filename\n"
client:
"MKDIR filename"
Requesting a file/directory
---------------------------
master sends:
"GET filename\n"
client replies:
"PUT size md5 permission atime ctime mtime filename\n"
octets [size bytes]
- or -
"MKDIR permission atime ctime mtime filename\n"
- or -
"SLNK filename\ntarget-file"
Sending a file
--------------
master sends:
"PUT size md5 permission atime ctime mtime filename\n"
octets [size bytes]
client replies:
"GET filename\n"
Making a file
-------------
master sends:
"MKDIR permission atime ctime mtime filename\n"
client replies:
"MKDIR filename"
Creating a symlink
------------------
master sends:
"SLNK filename\ntargetfile"
client replies:
"GET filename"
Checking if a file exists
-------------------------
master sends:
"EXISTS filename"
client replies
"YES"
-or-
"NO"
Creating a hardlink*
-------------------
master sends:
"HLNK filename\ntargetfile" (if master determines that one of file1..file3 exists)
client replies
"GET filename"
LINKS filename*
----------------
master sends:
"LINKS filename" (returns returns all files that is linked with this file)
client replies:
"LINKS 3 filename\nfile1\nfile2\nfile3"