oliverhentairules

a question for the zip command

Oct 19th, 2014
2,232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. Hello guys !
  2.  
  3. That's supposedly simple, but I can't get it to work, can I please humbly ask for quick coding help ?
  4. - I have a code line that works
  5. - and I want to adapt it to a slightly different use
  6.  
  7. *
  8.  
  9. My code line that works :
  10. find . -name '*.zip' -exec zip -fv {} \;
  11.  
  12. That runs zip -fv on all the zip files inside the current directory. With the result to "freshen" the files if I'm storing in the current directory a different version of one of the files present in the zips.
  13.  
  14. *
  15.  
  16. The different zip command I want to replace the former zip command with :
  17. zip -rv target_file.zip totally_NEW_file_to_add
  18.  
  19. Why ? To make sure ALL the zip files contain a certain file. The zips already having that file will be unaffected, the zips that didn't have that file yet will see that file added to them.
  20.  
  21. Actual example :
  22. zip -rv Noukyuu\,_Coach_\(English\)_\(www.hentairules.net\).zip notes\ and\ info\ from\ the\ uploader.txt
  23. adding: notes and info from the uploader.txt (in=2010) (out=1009) (deflated 50%)
  24. total bytes=7574719, compressed=7245537 -> 4% savings
  25. That added the file "notes and info from the uploader.txt" to the file Noykyuu,_Coach_(English)_(www.hentairules.net).zip
  26.  
  27. *
  28.  
  29. And where I'm clueless, it's to replace the generic
  30. "zip -fv" "to all the files one after the other"
  31. with
  32. "zip -rv" "to all the files one after the other" notes\ and\ info\ from\ the\ uploader.txt
  33.  
  34. After : find . -name '*.zip' -exec ... well, exec something.
  35.  
  36. Please, would you know how it can be done ?
  37. Thank you very much ! :)
Add Comment
Please, Sign In to add comment