Skip to content

Instantly share code, notes, and snippets.

@ArondeParon
Created October 16, 2012 17:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ArondeParon/3900726 to your computer and use it in GitHub Desktop.
Save ArondeParon/3900726 to your computer and use it in GitHub Desktop.
Cpanel DNS zone restoration after 11.34.0 update
#!/bin/bash
for user in /var/cpanel/users/*; do
username=$(basename $user)
if [ -d /backup/cpbackup/daily/$username ]
then
if [ -d /backup/cpbackup/daily/$username/dnszones ]
then
for file in /backup/cpbackup/daily/$username/dnszones/*; do
cp $file /var/named/
done
else
echo "Could not find dnszones directory"
fi
else
echo "Backup for $username does not exist"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment