SHARE
TWEET

rmbadfiles.sh

a guest Jul 21st, 2015 601 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. #Удалялка битых файлов из каталогов.
  3. #В переменную FULL_PATH прописываем ПОЛНЫЙ путь до пака.
  4. FULL_PATH='/media/storage/pic/unsorted/70Gb_BoardPack/'
  5.  
  6. find "$FULL_PATH" > /tmp/filelist.txt
  7. while IFS='' read -r line || [[ -n $line ]]; do
  8.     if [ $(file "$line" | grep -P '.*: data$' | wc -l) -ne 0 ]
  9.     then
  10.         rm "$line"
  11.     fi
  12. done < "/tmp/filelist.txt"
  13. rm /tmp/filelist.txt
  14. echo done!
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top