usr bin env python import os source usr resin resin-3 19 webapps backo

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#!/usr/bin/env python
import os
source = '/usr/resin/resin-3.0.19/webapps/backoffice/tmpimages/deals/large'
hosts = {'travelmgm': '/usr/resin/resin-3.0.19/webapps/backoffice/images/deals/large', 'travelweb': '/usr/apache/htdocs/travelist/images/deals/large', 'travelweb2': '/usr/apache/htdocs/travelist/images/deals/large', 'travelsdrs2': '/usr/apache/htdocs/travelist/images/deals/large', 'travelweb3': '/usr/apache/htdocs/travelist/images/deals/large', 'travelweb3': '/usr/apache-dev/htdocs/travelist/images/deals/large', 'traveltest': '/usr/apache/htdocs/travelist/images/deals/large'}
for host, directory in hosts.items():
status = os.system("scp -r %s %s:%s" % (source, host, directory))
if status:
print host
break