circulosmeos / gztool

extract random-positioned data from gzip files with no penalty, including gzip tailing like with 'tail -f' !
https://circulosmeos.wordpress.com/2019/08/11/continuous-tailing-of-a-gzip-file-efficiently/
134 stars 12 forks source link

Can we make it so I can 'write' gzi files to a different directory? #3

Closed munntjlx closed 4 years ago

munntjlx commented 4 years ago

I have a situation where I have given a user RO access to a growing log file, but don't want to give them 'write' access to the logs directory/files. Is there a way to use gztool to reference an index in a DIFFERENT directory than the 'fully readable' growing gzip file? I want them to be able to tail -f like the file w/o r/w access to the gzip file.

munntjlx commented 4 years ago

P.S. Great project! Nice for rsyslog compressed gzip files that always grow.

circulosmeos commented 4 years ago

Hi, @munntjlx Great to hear this project is useful!

Sure, you can do that using -I parameter to tell gztool the complete path to the index file. For example to do a continuous tail, writing/reusing an index in /tmp :

gztool -T -I /tmp/myindex.gzi compressed.gz

PS: in the Examples section there are a lot of use cases for ease of use. I'm gonna update -I example :-)