Skip to content

Instantly share code, notes, and snippets.

@karlbaillie
Created April 2, 2013 20:40
Show Gist options
  • Save karlbaillie/5295971 to your computer and use it in GitHub Desktop.
Save karlbaillie/5295971 to your computer and use it in GitHub Desktop.
Extract a directory full of cPanel backups (tar.gz's) and their corresponding "homedir.tar" file's within each in one go.
#!/bin/bash
FILES=./*.tar.gz
for f in $FILES
do
echo "Extracting $f..."
tar -xzf $f
n=$(basename $f .tar.gz)
echo "Unpacking $n/homedir.tar to ./$n/..."
tar -xf $n/homedir.tar -C ./$n/
echo "Done"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment