title: How to create tar for files older than 7 days using linux shell scripting
body: <p>I'm writing shell script to backup files older than 7 days. Here is my code. But i'm not getting expected result. Can anyone correct me?</p>
  
  <pre><code>#!/bin/bash
  # Backup files
  
  files=($(find /var/log/ -mtime +"7"))
   for files in ${files[*]}
   do
           echo $files
           tar cvfz backup.tar.gz $files
   done
  </code></pre>