Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- DIRNAME='dirXXXXX'
- to=$(mktemp -p . -d "$DIRNAME")
- size=0
- for f in *.jpg *.png *.jp2; do
- f_size=$(stat -c %s "$f")
- mv "$f" "$to"
- ((size += f_size))
- if ((size > 20000000)); then
- to=$(mktemp -p . -d "$DIRNAME")
- size=0
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement