-   Linux - General (
-   -   Bash Shell Script - Check SQL file for corruption (

RML1992 09-12-2012 11:08 AM

Bash Shell Script - Check SQL file for corruption
Does anyone know anyway of using a shell script, to use an if statement to check whether an SQL file is corrupt?

michaelk 09-12-2012 11:35 AM

And what database are we running?

RML1992 09-13-2012 06:16 AM

A MySQL Server. A script on another server creates a SQL dump and sends it to a backup server and then a script on the backup server drops the old database and imports it. But I would like to get the script to check whether the SQL dump is corrupt before dropping the old database. If you have any suggestions they would be much appreciated :).

chrism01 09-14-2012 01:47 AM

Take the hash of the file before transmission eg md5sum or sha256sum and compare after copy.
TBH though, if you use eg scp, I reckon that will ensure a clean copy, but no harm in checking if paranoid :)

All times are GMT -5. The time now is 08:49 AM.