Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. #!/bin/bash
  2. PICTURE_DIR=/cygdrive/h/Pictures
  3. SOURCE="$1"
  4. TARGET="$2"
  5.  
  6.  
  7.  
  8. echo -----------------------------------
  9. echo Processing $SOURCE
  10.  
  11. mkdir $PICTURE_DIR/$TARGET/ 2> /dev/null
  12.  
  13. for year in {2016..1999}
  14. do
  15. echo "Creating directory : " mkdir "$PICTURE_DIR"/"$TARGET"/"$year"
  16. mkdir "$PICTURE_DIR"/"$TARGET"/"$year"
  17. for month in {1..12}
  18. do
  19. if [ $month -lt 10 ]
  20. then
  21. month="0"$month
  22. fi
  23. echo "Creating directory : " mkdir "$PICTURE_DIR"/"$TARGET"/"$year"/"$year$month"
  24. mkdir "$PICTURE_DIR"/"$TARGET"/"$year"/"$year$month"
  25. echo find $SOURCE -name "D*_$year$month*" -exec mv -f {} "$PICTURE_DIR/$TARGET/$year/$year$month/" \;
  26. find "$SOURCE" -iname "D*_$year$month*" -exec mv -f {} "$PICTURE_DIR/$TARGET/$year/$year$month/" \;
  27.  
  28. done
  29. find "$SOURCE" -type d -empty -delete
  30. done
  31.  
  32. find $PICTURE_DIR -type f -iname Thumbs.db -delete
  33. find $PICTURE_DIR -type f -iname desktop.ini -delete
  34. find $PICTURE_DIR -type f -iname .dropbox* -delete
  35. find $PICTURE_DIR -type d -empty -delete
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement