Rsync syntax error when run from bash script

You are passing your option list as a single argument, when it needs to be passed as a list of arguments. In general, you should use an array in bash to hold your arguments, in case any of them contain whitespace. Try the following: mkdir -p “/backup/$HOST/$NAME/$TODAY” #source directory SRC=”https://stackoverflow.com/questions/22030280/$MNT” #link directory LNK=”/backup/$HOST/$NAME/$LAST/” #target directory … Read more

Python Subprocess.Popen from a thread

You didn’t supply any code for us to look at, but here’s a sample that does something similar to what you describe: import threading import subprocess class MyClass(threading.Thread): def __init__(self): self.stdout = None self.stderr = None threading.Thread.__init__(self) def run(self): p = subprocess.Popen(‘rsync -av /etc/passwd /tmp’.split(), shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE) self.stdout, self.stderr = p.communicate() myclass = MyClass() … Read more