huafengxi / pdo

xargs with timeout and more

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pdo

xargs from file

./pdo.py rsync -avz ~/.ssh @hosts.list:

dup stdin

dup stdin for each ip list in hosts.list

echo date | ./pdo.py ssh -T @hosts.list

xargs with timeout

echo date |timeout=1 ./pdo.py ssh -T root@@hosts.list

parallel

cat ... | par=10 ./pdo.py ...

dryrun

cat ... | par=-1 ./pdo.py ...

multiple column

ARGS=a.list ./pdo.py echo '$k1 $k2'

auto sudo passwd

echo passwd | sudo -S xxx

auto ssh passwd

  1. see sshpass, download prebuilt binary
  2. see also apass.py and yes.py in this repo which based on pexect

best practice for complex cmds

save cmds to a script file, then

cat a.sh | ./pdo.py ssh @ip.list

About

xargs with timeout and more


Languages

Language:Python 100.0%