[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Cat a log file into a ZIP file..



Simon wrote:
s. keeling wrote:

Incoming from Simon:

My question is, is there any way for us to 'cat' the access.log onto the access.log within the ZIP file? I would like to be able to produce a ZIP file of the months access and error logs for clients....



cat blah | gzip >> archive.gz


Hey.. Thanks for the reply.. But the file that have is a .zip file?




To do it with zip, use `zip <file.zip> -'

However, gzip is a better compression than zip, and bzip2 better again.


# cat /var/log/squid/access.log|zip access.log.zip -
  adding: - (deflated 87%)

# cat /var/log/squid/access.log|gzip -9 > access.log.gz

# cat /var/log/squid/access.log|bzip2 -9 > access.log.bz2

# du -sh /var/log/squid/access.log access.log.*
1.5M    /var/log/squid/access.log
144K    access.log.bz2
188K    access.log.gz
200K    access.log.zip

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


Reply to: