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?
|
And what database are we running?
|
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 :).
|
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:11 PM. |