Apr 4, 2019
#pigz
#gzip
#parallel
To compress using gzip format but using all your available cores:
tar --use-compress-program=pigz -cf archive.tgz /path/to/source Or if you want to pipe it:
tar -cf - source | pigz > archive.tgz To decompress use tar -xvf archive.tgz as usual.
The output of pigz is compatible with gzip
…
Apr 26, 2018
#xargs
#parallel
To run a script in parallel using xargs:
printf %d\\n {0..9} | xargs -n 1 -P8 sleep In this case sleep is going to be call 8 times (-P8) using has the input an int from 0 to 9.
From the man:
-P maxprocs Parallel mode: run at most maxprocs invocations of utility at once.
…
Jun 3, 2017
#ssh
#parallel
pdsh - issue commands to groups of hosts in parallel
Install:
brew install pdsh Usage:
pdsh -R ssh -w ^servers.txt "<command>" In where servers.txt is something like:
10.8.4.2 10.8.4.3 10.8.4.4 one-liner:
pdsh -b -w "10.8.4.2, 10.8.4.3, 10.8.4.4" "<command>" -b Disable ctrl-C status feature so that a single ctrl-C kills parallel job. (Batch Mode)
…