Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- PICTURE_DIR=/cygdrive/h/Pictures
- SOURCE="$1"
- TARGET="$2"
- echo -----------------------------------
- echo Processing $SOURCE
- mkdir $PICTURE_DIR/$TARGET/ 2> /dev/null
- for year in {2016..1999}
- do
- echo "Creating directory : " mkdir "$PICTURE_DIR"/"$TARGET"/"$year"
- mkdir "$PICTURE_DIR"/"$TARGET"/"$year"
- for month in {1..12}
- do
- if [ $month -lt 10 ]
- then
- month="0"$month
- fi
- echo "Creating directory : " mkdir "$PICTURE_DIR"/"$TARGET"/"$year"/"$year$month"
- mkdir "$PICTURE_DIR"/"$TARGET"/"$year"/"$year$month"
- echo find $SOURCE -name "D*_$year$month*" -exec mv -f {} "$PICTURE_DIR/$TARGET/$year/$year$month/" \;
- find "$SOURCE" -iname "D*_$year$month*" -exec mv -f {} "$PICTURE_DIR/$TARGET/$year/$year$month/" \;
- done
- find "$SOURCE" -type d -empty -delete
- done
- find $PICTURE_DIR -type f -iname Thumbs.db -delete
- find $PICTURE_DIR -type f -iname desktop.ini -delete
- find $PICTURE_DIR -type f -iname .dropbox* -delete
- find $PICTURE_DIR -type d -empty -delete
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement