0

Doing a test in a production enviroment with rotation logs with 2 days just for testing purposes with gizp files. Created a test file at /tmp/.

/etc/init.d/test

/tmp/test/*.gz {
       daily
       missingok
       rotate 2
       notifempty
       prerotate
         /root/log_mv.sh
       endscript
}

Didn't use the compress statement at /etc/init.d/test and I'm not figure out how could I group a bunch of .gz files by day and i could extract those files that are using logrotate.

My scenario is MobaXterm application into Windows 10 Pro and I need to extract these files generated by logrotate with a extension that didn't use compression.

logrotate examples

7
  • 1
    I realize that English is probably not your first language and honestly have A LOT of respect for you but your question confuses me. "Add a zip extension".. you mean use the ZIP format? You mean instead of Gzip, you want old school ZIP? You want to add a zip extension? mv file.gz file.zip.. please (if you can) make your details more clear. Commented Jan 29, 2021 at 15:13
  • So if you are in linux, what you want is called a "tar ball" (because it uses tar).. this combines files without compressing them. Usually, people tar the files first, them GZip the tar ball.. what you want is the other way around. :) Commented Jan 29, 2021 at 22:46
  • According with your reply will edit the post (let the question cleaner)... These logs are located at Linux and I realized that I can use 7zip for a tgz file, but did not catch how could I do the whole task... Point me out if this question is clear... You are right I have .gz files and want a .tgz file that group by day. @SeñorCMasMas
    – Marlon
    Commented Jan 31, 2021 at 1:52
  • 1
    So.. first of all, I am not an expert with logrotate. I have done a whole lot of stuff like you are trying to do though. (including using MobaXTerm) You want first to group these logs on the Linux box by date into a single compressed file?, transfer them to windows? then decompress them from the windows side? I am still trying to understand. I am betting that you will need to write a bash script for this. Commented Jan 31, 2021 at 19:56
  • 1
    I have found that creating a windows share is the easiest way to go for the file transfer. Make a stupid user (I call mine LinuxUser) in windows and give them access to a windows share you create. Use SMB to copy the files there via cron job on a schedule. You can make a trigger on the windows side to process the files via powershell using FileSystemWatcher .. in fact, if you are more comfortable with windows, you can do ALL of the work on the windows side. No need to even compress the logs. Commented Feb 1, 2021 at 16:48

0

You must log in to answer this question.

Browse other questions tagged .