-
-
Save jotapepinheiro/956c5d8ef7d30934cb04 to your computer and use it in GitHub Desktop.
Compactar pastas .sh
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/sh | |
# Corrigir /bin/sh^m bad interpreter no such file or directory | |
# dos2unix *.sh | |
cd /home/proja380/public_html/wp-content/uploads/ | |
caminho=2012 | |
echo 'Compactando pasta '$caminho; | |
# http://www.tutorialspoint.com/unix_commands/tar.htm | |
find $caminho -maxdepth 1 -mindepth 1 -type d | while read f; do tar -Pzcf "$f.tar.gz" "$f" | echo "$f.tar.gz OK"; done; exit; | |
# cd /home/admin/web/projac.com.br/public_html/wp-content/2012 | |
# wget http://1.1.1.1/~proja380/wp-content/uploads/2012/06.tar; | |
# DESCOMPACTAR | |
# for i in `find . -name '*.tar.gz'`; do tar -xzf `dirname$i` $i; done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment