4 ms·
True, but for a large number of hosts, going manually through prompts doesn't scale anymore. Sometimes you just want to check whether all hosts have the same co
by paskozdilar 5y ago
True, but for a large number of hosts, going manually through prompts doesn't scale anymore. Sometimes you just want to check whether all hosts have the same configuration file, or something like that. That's where GNU Parallel can save your gluteus maximus:
cat hosts.txt | parallel --quote --timeout=10 ssh {} 'echo {} $(md5sum ~/.config/file)'
The above command would take a list of hostnames from the hosts.txt file, connect to each one, hash the config file and print out hostnames and hashes in one line per host.
- mekster 5y agoUnless entire operations can be finished automatically, you could still do, command_to_test && exit in the swarm of tmux tabs and let only the anomalies stay open.
- MainJane 5y agocat hosts.txt | parallel --quote --timeout=10 ssh {} 'echo {} $(md5sum ~/.config/file)' Also try: parallel --slf hosts.txt --timeout=10 --nonall --tag md5sum .config/file