Skip to content

Instantly share code, notes, and snippets.

@sujee
Created March 8, 2012 01:30
Show Gist options
  • Save sujee/1997859 to your computer and use it in GitHub Desktop.
Save sujee/1997859 to your computer and use it in GitHub Desktop.
hadoop-dns : backup /etc/hosts
#!/bin/bash
hosts=$(cat $HADOOP_HOME/conf/slaves | grep -v '#')
for host in $hosts
do
echo "------------------" $host "------------"
ssh -o StrictHostKeyChecking=no root@$host "cp /etc/hosts /etc/hosts.orig"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment