process killed -- delete output file?

Posted by user151841 on Stack Overflow See other posts from Stack Overflow or by user151841
Published on 2010-04-21T13:38:22Z Indexed on 2010/04/21 14:43 UTC
Read the original article Hit count: 295

Filed under:
|

I have a bash script that runs on our shared web host. It does a dump of our mysql database and zips up the output file. Sometimes the mysqldump process gets killed, which leaves an incomplete sql file that still gets zipped. How do I get my script to 'notice' the killing and then delete the output file if the killing occurred?

© Stack Overflow or respective owner

process killed -- delete output file?

Posted by user13743 on Super User See other posts from Super User or by user13743
Published on 2010-04-21T13:38:22Z Indexed on 2010/04/21 13:43 UTC
Read the original article Hit count: 295

Filed under:

I have a bash script that runs on our shared web host. It does a dump of our mysql database and zips up the output file. Sometimes the mysqldump process gets killed, which leaves an incomplete sql file that still gets zipped. How do I get my script to 'notice' the killing and then delete the output file if the killing occurred?

© Super User or respective owner

Related posts about bash

Related posts about shell-scripting