How to delete the files older than a given date in bash?
      Rotating logs and backups: the command to clean a server.
      
  
    The command find, with the option mtime, allows
    you to find the files which have been modified more than 7 days ago.
    The type f is here to look only for files.
    
    The result is given to the command rm using the option --exec of find.
Find then delete the files older than 7 days in bash
find $log -type f -mtime +7 -exec /bin/rm -f {} \;
You can replace the deletion with any other action: archiving, moving..
