Home > One Liners > Updating a file on all zones at the same time

Updating a file on all zones at the same time

November 3rd, 2009 admin Leave a comment Go to comments

I recently modified /etc/resolv.conf on all of my global zones after building new nameservers. I wanted a quick way to copy this updated configuration to all child zones. A simple one-liner does the trick on each global zone (assuming all your zones are in the /var/zones zonepath):

# zoneadm list | grep -v global | while read zone; do cp -p /etc/resolv.conf /var/zones/${zone}/root/etc; done

Cheers,
Kevin

Categories: One Liners Tags:
  1. No comments yet.
  1. No trackbacks yet.