Im trying to create a backup of approx. 1400 repositories. These repos are all cloned to a VM. Now i need to compress these into 1 zip, but this takes a long time. currently I've set the cap on 600min which my current implementation reaches before being 2/10th done.
Using powershell 7.2.2 and tried with both Compress-Archive and the 7Zip4Powershell module. And tried splitting the repos up in smaller batches since compressing all the repos at once maxed out the RAM on the VM. by using batches I could run garbage collection between each batch so RAM usage wasn't a problem. although appending files to an exisiting Zip seems to unzip the original first to add new files afaik (this just makes it take longer probably).
So does anyone have any tips on an implementation that would take less than 600min? Does not have to adhere to a powershell solution.
Its about ~2 million files and ~150gb size.
Compress-7Zip -Path "C:\repos\batchX" -ArchiveFileName $zipfile -Append -Format Zip -CompressionLevel Fast -CompressionMethod Lzma2
Compress-Archive -Path "C:\repos\batchX\*" -DestinationPath $zipfile -CompressionLevel "Optimal" -Update