Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #!/bin/python3
  2.  
  3. import gzip
  4. import glob
  5.  
  6. gzippedfiles = list(glob.glob("access.log*.gz"))
  7.  
  8. with open("accesscompiled.log", "wb") as outfile:
  9. with open("access.log", "rb") as infile:
  10. outfile.write(infile.read())
  11. with open("access.log.1", "rb") as infile:
  12. outfile.write(infile.read())
  13. for gzippedfile in gzippedfiles:
  14. with gzip.open(gzippedfile, "rb") as infile:
  15. outfile.write(infile.read())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement