Skip to navigation
Multi process rsync with python
08.09.15
1. create a key ssh-keygen 2. put the public key of your server to the destination server with ssh-copy-id -i ~/.ssh/id_rsa.pub root@MYSERVER.com 3. python functions what loop a picture folder and sync them to a online server def sync(self): sizes = ['15','30','50','85','120','120','150','250','600','1000','1200'] jobs = {} for i in sizes: size = i+'x'+i cmd = "rsync -az --delete --exclude=THUMBS.db --exclude=Thumbs.db* /mnt/sdb1/pictures/"+ size +"/ root@MYSERVER.COM:/var/customers/webs/shop/img/pictures"+size jobs[i] = subprocess.Popen(cmd, shell=True,stdout=subprocess.PIPE, stderr=subprocess.PIPE)
https://pythonspot.com/python-subprocess/
Reply
Anonymous
Information Epoch 1732581193
Data dominates.
Home
Notebook
Contact us