[PYTHON] Envolver rsync
#!/usr/bin/env python #Envolver rsync para sincronizar directorios from subprocess import call import sys source = "/home/oracle/dir1/" target = "oracle@stan:/home/oracle/dir1" rsync = "rsync" arguments = "-a" cmd = "%s %s %s %s " % (rsync, arguments, source, target) def sync(): ret = call(cmd, shell=True) if ret != 0: print "rsync failed" sys.exit(1) sync()
Comentarios