title: How to create zip/gz/tar files for if the files are older than particular days in UNIX or Linux
body: <p>I need a script file for backup (zip or tar or gz) of old log files in our unix server (causing the space problem). Could you please help me to create the zip or gz files for each log files in current directory and sub-directories also?</p>
  
  <p>I found one command which is to create gz file for the older files, but it creates only one gz file for all older file. But I need individual gz file for each log file.</p>
  
  <pre><code>find /tmp/log/ -mtime +180 | xargs  tar -czvPf  /tmp/older_log_$(date +%F).tar.gz
  </code></pre>
  
  <p>Thanking you in advance.</p>