-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compress with .gz extention #5
Comments
Hi, I found a way to solve this... compress: function (source, dest) { // Modified compress function, add extension .gz
// Also removes logs older than 30 days
return 'cat ' + source + ' | gzip -c9 > ' + dest + '.gz; rm -f ' + dest +
'; find ./logs/* -mtime +30 -delete';
} I am leaving this open for anyone to tell a better way to add the .gz extension |
Have you tried to use a different file name generator function ? The way to change file names is to use an appropriate generator . |
Closing due to lack of feedback |
Since it took me a while to understand what iccicci meant by "Have you tried to use a different file name generator function?", I just wanted to elaborate and say he means if you're using compression and want the extension, add ".gz" to your returned file name in the generator function. |
I am trying to use rotating-file-stream with Hapi.js and good.
My trouble is that the compresses files don't have a .gz extention and that makes most Linux utilities confuzed.
If I change the compress string to add '.gz', the file with the same name is not deleted but it's size is set to zero !!! I expected the file to be deleted.
BTW: the docs say not to delete source file, I tried it and strage errors happen (as expected)
This is the relevant part of my setup:
This is what I get:
The text was updated successfully, but these errors were encountered: