I'm not quite familiar enough with bash to figure this out properly, I'll try to be brief with what I'm trying to figure out! I have many paths stored in a file, along with their size (in G), such as below:(sizegb,path)1,/bin/path15,/bin/path225,/bin/path3There would be hundreds of paths like this.I'll have a second file with destination disks they're going to be moved to such as (GB representing space left): (sizeGB,DISK)376,DISK1555,DISK2Since there are generally hundreds of areas, varying in size, what would be the best way to evenly sort them between the two disks? that is to say, if I have 600 GB to move, to allocate ~400G to DISK2, and ~200G to DISK1 (so the remaining sizes would be 176GB,DISK1 and 155GB,DISK2)with an output something like:PATH,DISKPATH,DISK2Thanks in advance!PS,I'm also not asking for someone else to do this completely, I'm just looking for some good pointers on where to start, or ideas on what a practical way to do this would be!
Evenly allocate resources over multiple desinations
bash;files;scripting