Reputation: 31
I have a directory "mapnik" with hundreds of sub-directories, each containing more than 10000 files. I would like to zip "mapnik" recursively, preserving the folder-structure but only adding files greater than 103 Byte to the archive.
How can I accomplish this? I tried using find and pipes, but with the wrong syntax and the huge number of files, "trial and error" is not the best way to get it done ;)
Thanks for your help guys!
Upvotes: 2
Views: 671
Reputation: 31
Delan's suggestion produced some kind of zip-error whith files of the same name. But it got me on the right track. This is what worked for me:
cd mapnik
find . -size +103c -print | zip archive.zip -@
Upvotes: 1
Reputation: 81384
How about
find -size +103c -print0 | xargs -0 zip -r outname.zip
Upvotes: 2