title: How to exclude a specific format file in my find command?
body: <p>I am trying to compress files which have file extension .csv and <em>.log</em>, I dont want to compress files which are already compressed and are in .gz format. How do I exclude these .gz files in my find so it doesnt do zipping twice or end up throwing up an error. Below is the find command I tried to exclude files which are in .gz format but this doesnt work.</p>
  <p><code>find ${dir_name}  -type f \( -name &quot;*.csv&quot;  -o -name &quot;*.log&quot; \) ! -name &quot;*.gz&quot; -mtime +${LOG_COMPRESS}  ! -mtime +${LOG_RETENTION}  -exec gzip {} \;</code></p>