Skip to content

Instantly share code, notes, and snippets.

@LukeChannings
Created August 25, 2011 21:07
Show Gist options
  • Save LukeChannings/1171957 to your computer and use it in GitHub Desktop.
Save LukeChannings/1171957 to your computer and use it in GitHub Desktop.
A script to check for films in a directory, and move them to another directory.
#!/bin/bash
##
# Check for Film
# - A script to check for films in a directory,
# - and move them to another directory.
#
##
CHECKDIR="/Volumes/Media/Downloads" # Directory to check for videos.
MOVEDIR="/Volumes/Media/Videos/Films" # Directory to move videos to.
# Loop through applications.
while read -r file; do
# Check if the file is greater than 600MB.
if [ `stat -f%z "$file"` -gt 629145600 ];then
# Move to the destination.
mv "$file" "$MOVEDIR"
fi
done < <(find $CHECKDIR -name *.avi -maxdepth 1 2> /dev/null)
echo "Done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment