Skip to content

Instantly share code, notes, and snippets.

@JosephRedfern
Created May 23, 2012 16:39
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 JosephRedfern/2776271 to your computer and use it in GitHub Desktop.
Save JosephRedfern/2776271 to your computer and use it in GitHub Desktop.
cPanel public_html backup extractor
#!/bin/bash
#This script assumes that your cPanel backup tarball is in the same directory as your public_html folder
#It doesn't do any verification, and will just quit if something goes wrong (due to set -e).
#Use at your own risk!
set -e
echo "Extracting Backup! If you dont see the message: All done!, then something has gone wrong."
cd $1
tar -xf back*
cd back*
tar -xf homedir.tar
cp -r public_html/* ../public_html/
echo "All done!"
@JosephRedfern
Copy link
Author

I used it like this:

cat sites.txt|xargs -I {} ./putbackup.sh {}

Where sites.txt was a list of the domains I had backed up, which was held in a folder which also held folders named after each domain, which held the backup tarball and public_html folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment