title: Delete *.ZIP files older than 15 days
body: <p>I'm currently using a PHP script to back up my databases daily and it works like a charm.  After the backup, I am using the shell script below to zip the backup file:</p>
  
  <pre><code>find /home/root/BACKUPS/backup.sql | xargs zip -czvPf /home/root/BACKUPS/$(date +%F)_backup.sql.zip
  </code></pre>
  
  <p>I need to add a piece of code that will also scan previously created <code>"$(date +%F)_backup.sql.zip"</code> and delete any that are older than 15 days.</p>
  
  <p>Does anyone have any recommendations on how to make this work?</p>
  
  <p><strong>UPDATE 10/16/2019 1601HRS EST</strong></p>
  
  <pre><code>find /home/root/BACKUPS/backup.sql   | xargs zip -czvPf /home/root/BACKUPS/$(date +%F)_backup.sql.zip
  find /home/root/BACKUPS/ -mtime +14 -type f -iname '*.backup.sql.zip' -exec rm {} \;
  </code></pre>
  
  <p>This did not remove the files that should have been removed. I'm not sure what I'm missing; maybe a ';' after the first line. Although the first line is running properly by zipping and naming the SQL file, the second line is not working.</p>