Skip to content
Robert Jack Will edited this page Feb 3, 2014 · 2 revisions

To prevent others from executing commands on a host it is possible to lock the host:

lock -m "motivation why I lock this host" [--force] <host_uri> [<host_uri> ...]

afterwards commands can only be executed by you, from the current target directory on the current host.

Example: lock the host "hostname01".

lock -m "(michael) I need to lock this host, because something is broken" host://hostname01

Example: hijacking a lock from somebody else.

lock -m "(michael) I had to hijack all locks." --force host://*

Attention:

when using the -m "message" option, the message should reflect the reason why you are doing what you are doing and include your name as well:

lock -m "Need this host. (michael)" host://hostname31

To release a lock use:

unlock <host_uri> [<host_uri> ...]

Example: release all of your locks on all target hosts.

unlock host://*