bash: Get last line of a huge gziped file
bash: Get last line of a huge gziped file 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 !). 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: str=`zcat ${PATHSAVE}/dumpFull.sql.gz | tail -n1` As database dump file is huge (currently more than 200Gb) this end process check take huge time to run (currently more than 180 minutes). I'm searching a way to extract quicker the last line of my .gz file ... any idea anyone ? Note 1: 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. Note 2: I'm aware about Percona xtraBackup but in my case I want to use mysqldump f...
