Parallelizing Copying public key to authorized_keys file
Here's a script I am using to copy my public key to the ~/.ssh/authorized_key on the 300+ servers I have at work:
Code:
# allservers.txt file contains all servers |
What if your script split allservers.txt in 2 parts and then work with each half and then split each half and then split all 4 parts so it will be 8 parts and again and again, recursively it could keep spliting until there is nothing to split, at the same time it can pass the keys for each server.
I hope this make sense to you. Regards |
Why bother throttling it?
Code:
# allservers.txt file contains all servers |
Split it into two scripts
script1: Code:
echo "Trying $1" Code:
for i in $(cat allservers.txt); do |
In suicidaleggroll's factoring you're going to want `&>>` not `&>`, or put the `&>` after the `done`. It's a pretty safe bet you're using bash, but if not, `&>` is a bashism, `1>>logfile 2>>&1` is the portable spelling.
EDIT: Oops, sorry, that script makes 300 logfiles, that'll work. Need. Less. Coffee. |
All times are GMT -5. The time now is 07:37 AM. |