@slicknik
If you are referring to the usage of subprocess.PIPE for stderr/stdout, that will work fine with 'shell=False' as demonstrated by this sample program (create a /tmp/foo.txt with some content first):
-------------------------------------------------------------------------------------------
import os
import subprocess
Are you piping the output of one command to another in the command that is passed into subprocess.Popen() in BackupRunner? If so, you can also do that like this:
-------------------------------------------------------------------------------------------
import os
import subprocess
@slicknik
If you are referring to the usage of subprocess.PIPE for stderr/stdout, that will work fine with 'shell=False' as demonstrated by this sample program (create a /tmp/foo.txt with some content first):
------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- -------
import os
import subprocess
command = '/usr/bin/cat /tmp/foo.txt' Popen([ '/usr/bin/ cat', '/tmp/foo.txt'], shell=False,
stdout= subprocess. PIPE,
stderr= subprocess. PIPE,
preexec_ fn=os.setsid)
backup_process = subprocess.
print '%s' % backup_ process. stdout. read() ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- -------
-------
Are you piping the output of one command to another in the command that is passed into subprocess.Popen() in BackupRunner? If so, you can also do that like this:
------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- -------
import os
import subprocess
command = '/usr/bin/cat /tmp/foo.txt' Popen([ '/usr/bin/ cat', '/tmp/foo.txt'], shell=False,
stdout= subprocess. PIPE,
stderr= subprocess. PIPE,
preexec_ fn=os.setsid)
backup_process = subprocess.
grep_process = subprocess. Popen([ '/usr/bin/ grep', 'blah'], shell=False,
stdin= backup_ process. stdout,
stdout= subprocess. PIPE)
print '%s' % grep_process. stdout. read() ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- -------
-------