++ed by:

1 non-PAUSE user.

Mike Schilli
and 1 contributors


    bucketize - Move files into buckets


    bucketize files ...

      # Make buckets 100MB in size
    bucketize -s 100m *.jpg



Set the bucket size


bucketize takes a number of files and moves them into subdirectories with limited size.

These subdirectories (buckets) are created on-the-fly, and named 001, 002, and so forth.

So, if you have 8 video files like

   10570148 wienerschnitzel 02.avi
   46988832 wienerschnitzel 03.avi
    3609584 wienerschnitzel 04.avi
   76198332 wienerschnitzel 05.avi
   53203604 wienerschnitzel 06.avi
  481153928 wienerschnitzel 07.avi
  442000760 wienerschnitzel 08.avi
  292597256 wienerschnitzel 09.avi

you can ask bucketize to put them in buckets not exceeding 1GB each:

    $ bucketize -s 1g *.avi

In this case, bucketize will create the following directory structure:

  wienerschnitzel 02.avi  wienerschnitzel 04.avi  wienerschnitzel 06.avi
  wienerschnitzel 03.avi  wienerschnitzel 05.avi  wienerschnitzel 07.avi
  wienerschnitzel 08.avi  wienerschnitzel 09.avi

It is an error if a numbered directory already exists, make sure you start with a clean slate.


  $ bucketize *.jpg

  $ bucketize -s 2g *.jpg


Copyright 2007 by Mike Schilli, all rights reserved. This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.


2007, Mike Schilli <cpan@perlmeister.com>