Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- lista=$(sudo find ~/teste -name "*2.bak")
- tamTotal=0
- logDir=~/teste/log.txt
- for arq in $lista; do
- tam=$(du -b $arq | cut -d" " -f1)
- tamTotal=$(expr $tamTotal + $tam)
- echo "Excluindo arquivo: " $arq
- rm $arq
- echo $arq >> $logDir
- done
- echo $tamTotal >> $logDir
- mail tuliomonteazul@gmail.com << cat $logDir
Add Comment
Please, Sign In to add comment