1 ---
2 title: 'dav lock'
3 ---
4
5 **`dav lock [-pc] <url>`**
6
7 Creates a lock on the resource specified by the *url*. The lock is an exclusive write lock with infinite depth.
8
9 If the resource is successfully locked, a lock token for this resource is printed to stdout. This lock token should be saved somewhere to unlock the resource eventually.
10
11 **`-p`** disable file name and path decryption if enabled
12
13 **`-c`** enable file name and path decryption
14
15 **`-T <seconds>`** specify the lock token timeout in seconds
16
17 ### Example 1: lock resource and use the lock token
18
19 $ dav lock myserv/resource
20 opaquelocktoken:0454905e-f2ff-45c4-a3d7-5c4e4db5ce37
21 $ dav put -L opaquelocktoken:0454905e-f2ff-45c4-a3d7-5c4e4db5ce37 myserv/resource newfile
22 $ dav unlock -L opaquelocktoken:0454905e-f2ff-45c4-a3d7-5c4e4db5ce37 myserv/resource
23
24
25