Hacker News new | ask | show | jobs
by webreac 4940 days ago
My most common use of xarsg -P is for compressing logs on remote hosts before downloading them: cat RemoteHosts | xargs -P 0 -n 1 -I Host rsh Host gzip -9 xxx/*.log The cool thing is that it waits until the completion of all the commands before returning.
2 comments

With GNU Parallel it looks like this:

  parallel --nonall --slf RemoteHosts -j0 gzip -9 xxx/*.log
If you have multple CPUs on your remote hosts and have GNU Parallel installed there:

  parallel --nonall --slf RemoteHosts -j0 --arg-sep , parallel gzip -9 ::: xxx/*.log
rsh or ssh? All my VPSs have rsh disabled.