Created
April 2, 2013 20:40
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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