Created
September 18, 2012 22:16
-
-
Save joelataylor/3746288 to your computer and use it in GitHub Desktop.
Remove small files
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 | |
# The goal of this script is to delete any files under 1mb (1048576 bytes) | |
while read -r file; do | |
length=$(swift stat audio-in "$file" | grep 'Content Length' | sed 's/Content Length: //') | |
#echo "Length is: $length" | |
if (( length < 1048576 )) ; then | |
swift delete audio-in "$file" | |
#echo "deleting $file" | |
fi | |
done < <(swift list audio-in) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
::muscle::