Sunday, August 14, 2011

How to move 2Gb or bigger file in a script

#!/bin/sh

find /backup/include -printf '%s %p\n' | while read size name; do
    if [ "$size" -gt 2000000000 ]; then
        mv -i "$name" /backup/exclude
    fi
done
  

No comments:

Post a Comment