I've created a small Bash script that does a MySQL data dump. Because the dump can be fairly large I put the process in the background and then wait for either an error or the log to show up in the file system. I have the following code:
mysqldump main_db > /loc/to/dmp/file.sql 2>/loc/to/error/log/file.log &
The problem is that I get a '/loc/to/error/log/file.log' file the size of 0 (which I presume means no real error) sometimes when this command is run, which kills the process, even though there is no error.
I'm not sure why the STDERR would write a file when there was no data to write. Is this because of the &
background process?