Saturday, January 5, 2008

Script to automagically sort files.

Sources
http://ubuntuforums.org/showthread.php?t=526437

Original Script

gphoto2 -P # The -P option gets all your files from your
# camera, both pictures and videos

JPGS="*.JPG"
AVIS="*.AVI"

# Creating folders and moving JPG files

for file in $JPGS
do
mkdir /home///"`date -r $file +%Y%m`"
mv $file /home///"`date -r $file +%Y%m`"
done

# Creating folders and moving AVI files

for file in $AVIS
do
mkdir /home///"`date -r $file +%Y%m`"
mv $file /home///"`date -r $file +%Y%m`"
done

echo "Done, Boss!"


Ok

No comments: