<< Java 7 supports creating symbolic links | Home | X11 recording with ffmpeg >>

Oneliner to handle file system limitations on file move

A simple oneliner to move files to a file size limited file system (e.g. 2Gb)...
destdir=/destinationdir/../.. ; for f in * ; do s=$(stat -c %s "$f") ; if [ $s -ge $((2*1000*1000*1000)) ] ; then 7z a -mx=0 -tzip -v2000m "$destdir"/"$f".zip  "$f" ; else mv -v "$f" "$destdir"/"$f" ; fi ; done



Add a comment Send a TrackBack