Browse Source

[cluster] convert README to MarkDown

master
mcy 1 year ago
parent
commit
6b1e766cf0
2 changed files with 81 additions and 78 deletions
  1. 0
    78
      cluster/README
  2. 81
    0
      cluster/README.md

+ 0
- 78
cluster/README View File

@@ -1,78 +0,0 @@
1
-The cluster utilities are script allowing to work in parallel with a
2
-number of remote hosts, using utilities such as Parallel SSH (pssh) or
3
-fping. They all take as first and mandatory positional argument a host
4
-list name “NAME”; the list will be searched according to the following
5
-pattern:
6
-
7
-```  $XDG_CONFIG_HOME/cluster/NAME.lst
8
-
9
-($XDG_CONFIG_HOME being equivalent to $HOME/.config if unset.)
10
-For example, one can call the cluster-ping.sh script typing:
11
-
12
-```  cluster-ping my_hosts
13
-
14
-to use the hosts' file $XDG_CONFIG_HOME/cluster/my_hosts.lst
15
-
16
-The format of such a .lst file is one line per host name or IP address,
17
-for example:
18
-
19
-```
20
-192.168.42.1
21
-192.168.42.3
22
-priam
23
-```
24
-
25
-The scripts based on SSH use the local user's login name as remote login;
26
-this can be changed using the ``-l`` option, that must appear before the
27
-hosts' list on the command line, for example:
28
-
29
-``` cluster-run -l root openwrt_machines opkg install screen
30
-
31
-The provided scripts are detailed in the sequel.
32
-
33
-
34
-= cluster-ping.sh =
35
-
36
-Test the connectivity with the hosts of the list by sending them a ICMP
37
-echo packet.
38
-
39
-Dependency: fping
40
-
41
-
42
-= cluster-ssh.sh =
43
-
44
-Open a GNU Screen tab with an interactive SSH session for each host of
45
-the hosts' list. Must be run inside of an existing Screen.
46
-
47
-Dependencies: screen, ssh
48
-
49
-
50
-= cluster-run.sh =
51
-
52
-Run the same command on every host of the hosts' list.
53
-
54
-Dependency: parallel-ssh (pssh)
55
-
56
-
57
-= cluster-deploy.sh =
58
-
59
-Deploy one or more files in parallel on every host of the hosts' list.
60
-The files are copied in the remote user's home directory.
61
-
62
-By default, the files are transferred one by one, to make sure you notice
63
-the errors for each file (bad permissions, out of space, etc.), but you
64
-can use the -P switch to transfer them all at once (faster).
65
-
66
-While it is possible to transfer directories with the default option, to
67
-synchronise directories one would rather use the -r option, that uses
68
-prsync rather than pscp to transfer the files. With the -R option, the
69
-remote files that are not in the local copy will be deleted (rsync's
70
---delete option). In both cases, the transfer is done with rsync's -a
71
-(archive) option.
72
-
73
-Please note that unlike rsync, prsync cannot handle multiple local
74
-files, therefore the -P option is ignored when passed along with -r or
75
--R.
76
-
77
-Dependencies: parallel-scp (pscp), parallel-rsync (prsync), cluster-ping
78
-              (see above)

+ 81
- 0
cluster/README.md View File

@@ -0,0 +1,81 @@
1
+The cluster utilities are script allowing to work in parallel with a
2
+number of remote hosts, using utilities such as Parallel SSH (pssh) or
3
+fping. They all take as first and mandatory positional argument a host
4
+list name “NAME”; the list will be searched according to the following
5
+pattern:
6
+
7
+    $XDG_CONFIG_HOME/cluster/NAME.lst
8
+
9
+(`$XDG_CONFIG_HOME` being equivalent to `$HOME/.config` if unset.)
10
+For example, one can call the `cluster-ping.sh` script typing:
11
+
12
+    cluster-ping my_hosts
13
+
14
+to use the hosts' file `$XDG_CONFIG_HOME/cluster/my_hosts.lst`.
15
+
16
+The format of such a .lst file is one line per host name or IP address,
17
+for example:
18
+
19
+```
20
+192.168.42.1
21
+192.168.42.3
22
+priam
23
+```
24
+
25
+The scripts based on SSH use the local user's login name as remote login;
26
+this can be changed using the `-l` option, that must appear before the
27
+hosts list on the command line, for example:
28
+
29
+    cluster-run -l root openwrt_machines opkg install screen
30
+
31
+The provided scripts are detailed in the sequel.
32
+
33
+
34
+cluster-ping.sh
35
+---------------
36
+
37
+Test the connectivity with the hosts of the list by sending them a ICMP
38
+echo packet.
39
+
40
+**Dependency**: `fping`
41
+
42
+
43
+cluster-ssh.sh
44
+--------------
45
+
46
+Open a GNU Screen tab with an interactive SSH session for each host of
47
+the hosts list. Must be run inside of an existing Screen.
48
+
49
+**Dependencies**: `screen`, `ssh`
50
+
51
+
52
+cluster-run.sh
53
+--------------
54
+
55
+Run the same command on every host of the hosts list.
56
+
57
+**Dependency**: `parallel-ssh` (`pssh`)
58
+
59
+
60
+cluster-deploy.sh
61
+-----------------
62
+
63
+Deploy one or more files in parallel on every host of the hosts list.
64
+The files are copied in the remote user's home directory.
65
+
66
+By default, the files are transferred one by one, to make sure you notice
67
+the errors for each file (bad permissions, out of space, etc.), but you
68
+can use the `-P` switch to transfer them all at once (faster).
69
+
70
+While it is possible to transfer directories with the default option, to
71
+synchronise directories one would rather use the `-r` option, that uses
72
+prsync rather than pscp to transfer the files. With the `-R` option, the
73
+remote files that are not in the local copy will be deleted (rsync's
74
+`--delete` option). In both cases, the transfer is done with rsync's `-a`
75
+(archive) option.
76
+
77
+Please note that unlike rsync, prsync cannot handle multiple local files,
78
+therefore the `-P` option is ignored when passed along with `-r` or `-R`.
79
+
80
+**Dependencies**: `parallel-scp` (`pscp`), `parallel-rsync` (`prsync`),
81
+`cluster-ping` (see above)

Loading…
Cancel
Save