title: Get last line of a huge gziped file
body: <p>In a database backup process I generate a text dumpfile. As database is quite huge, dump file is huge too so I compresses it with gzip. Compression is done inline while dump is generated (thanks Unix pipe !).</p>
  
  <p>At the process end, I check dump file validity by watching the last line and check the "Dump completed" string presence. In my script I do it by extracting last line into a variable:</p>
  
  <pre><code>str=`zcat ${PATHSAVE}/dumpFull.sql.gz | tail -n1`
  </code></pre>
  
  <p>As database dump file is huge (currently more than 200Gb) this end process check take huge time to run (currently more than 180 minutes).</p>
  
  <p>I'm searching a way to extract quicker the last line of my .gz file ... any idea anyone ?</p>
  
  <p><strong>Note 1:</strong> For explain context, we can say database is MySql community, backup tool is mysqldump, generated dumpfile is a full text file. OS is CentOs. Backup script is Bash shell script.</p>
  
  <p><strong>Note 2:</strong> I'm aware about Percona xtraBackup but in my case I want to use mysqldump for this specific backup job. Time need for restauration is not an issue.</p>