I'm getting errors when reading from/writing to pipes that are fairly
large in size. To bypass this, I wanted to redirect output to a file
in the subprocess.Popen function, but couldn't get it to work (even
after setting Shell=True). I tried adding ">","temp.sql" after the
password field but mysqldump gave me an error.
p1 = subprocess.Popen(["mysqldump","--all-databases","--user=user","--
p2 = subprocess.Popen(["gzip","-9"], stdin=p1.stdout)
output = p2.communicate()
gzip: compressed data not written to a terminal. Use -f to force
For help, type: gzip -h
mysqldump: Got errno 32 on write
I'm using python rather than a shell script for this because I need to
upload the resulting file to a server as soon as it's done.