I recycled an old script I used several years ago to automatically generate an ISO image from selected subfolders. The idea is, that the content is written to CD/DVD archive as soon as the total capacity passes the media’s limit.
bestfit (release 0.2.0 by Oskar Liljeblad) was no longer
installed on my workstation, but it returned successfully.
Please visit this folder for documentation and sources.
I used the sources to build a 64-Bit Debian package just by a call to
fakeroot debian/rules binary from extracted contents of the `*.tar.gz.
bestfit is quite simple:
bestfit --quiet --invert --space="$((700*1024*1024/2048))" candidates/*
That will give me a list of folders I have to move away from
the remaining data will fit onto the 700MBs of a data CD.