Created
July 21, 2012 16:00
-
-
Save stanwu/3156259 to your computer and use it in GitHub Desktop.
check tgz files automatically
This file contains 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 | |
mkdir -p log | |
for i in `ls *.tgz *.tar.gz` | |
do | |
echo "Check $i..." | |
tar tvzf $i > log/$i.log | |
if [ $? != 0 ]; then | |
mv $i $i.error | |
echo "$i error!" | |
fi | |
done | |
for i in `ls *.tar.bz2` | |
do | |
echo "Check $i..." | |
tar tvjf $i > log/$i.log | |
if [ $? != 0 ]; then | |
mv $i $i.error | |
echo "$i error!" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment