Ich bin auf folgende Wege gekommen (Zeile 1 und 13):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | $ vmstat -t 1 3 | tee $(0<&2 tty) | gzip -9 >| x.gz procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu----- -----timestamp----- r b swpd free buff cache si so bi bo in cs us sy id wa st CEST 4 0 202008 130452 79696 2358668 11 90 2260 1469 1572 2714 25 9 65 1 0 2022-04-30 11:29:41 0 0 202008 125900 79696 2362372 0 0 0 0 943 1099 2 2 97 0 0 2022-04-30 11:29:42 0 0 202008 127292 79696 2362372 0 0 0 0 945 1063 1 0 99 0 0 2022-04-30 11:29:43 $ gzip -dc x.gz procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu----- -----timestamp----- r b swpd free buff cache si so bi bo in cs us sy id wa st CEST 4 0 202008 130452 79696 2358668 11 90 2260 1469 1572 2714 25 9 65 1 0 2022-04-30 11:29:41 0 0 202008 125900 79696 2362372 0 0 0 0 943 1099 2 2 97 0 0 2022-04-30 11:29:42 0 0 202008 127292 79696 2362372 0 0 0 0 945 1063 1 0 99 0 0 2022-04-30 11:29:43 $ vmstat -t 1 3 | tee >(gzip -9 >| x.gz) procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu----- -----timestamp----- r b swpd free buff cache si so bi bo in cs us sy id wa st CEST 3 0 202008 127628 79696 2361072 11 89 2240 1461 1562 2695 25 9 66 1 0 2022-04-30 11:29:53 0 0 202008 123608 79696 2365036 0 0 0 208 994 1213 2 1 98 0 0 2022-04-30 11:29:54 2 0 202008 125368 79696 2365080 0 0 0 280 940 1118 2 1 98 0 0 2022-04-30 11:29:55 $ gzip -dc x.gz procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu----- -----timestamp----- r b swpd free buff cache si so bi bo in cs us sy id wa st CEST 3 0 202008 127628 79696 2361072 11 89 2240 1461 1562 2695 25 9 66 1 0 2022-04-30 11:29:53 0 0 202008 123608 79696 2365036 0 0 0 208 994 1213 2 1 98 0 0 2022-04-30 11:29:54 2 0 202008 125368 79696 2365080 0 0 0 280 940 1118 2 1 98 0 0 2022-04-30 11:29:55 |
Die erste Variante funktioniert auch mit der sh
, für die zweite braucht man die bash
oder eine andere Shell. Hat jemand noch eine elegantere Idee?