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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env python
import os
config = {'/usr/resin/resin-3.0.19/webapps/backoffice/tmpimages/deals/large': {'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/'},
'/usr/resin/resin-3.0.19/webapps/backoffice/tmpimages/logos/sponsorships': {'travelmgm': '/usr/resin/resin-3.0.19/webapps/backoffice/images/logos/sponsorships',
'travelweb': '/usr/apache/htdocs/travelist/images/logos/sponsorships',
'travelweb2': '/usr/apache/htdocs/travelist/images/logos/sponsorships',
'travelsdrs2': '/usr/apache/htdocs/travelist/images/logos/sponsorships',
'travelweb3': '/usr/apache/htdocs/travelist/images/logos/sponsorships',
'travelweb3': '/usr/apache-dev/htdocs/travelist/images/logos/sponsorships',
'traveltest': '/usr/apache/htdocs/travelist/images/logos/sponsorships'},
'/usr/resin/resin-3.0.19/webapps/backoffice/tmpimages/logos/suppliers': {'travelmgm': '/usr/resin/resin-3.0.19/webapps/backoffice/images/logos/suppliers',
'travelweb': '/usr/apache/htdocs/travelist/images/logossmall',
'travelweb2': '/usr/apache/htdocs/travelist/images/logossmall',
'travelsdrs2': '/usr/apache/htdocs/travelist/images/logossmall',
'travelweb3': '/usr/apache/htdocs/travelist/images/logossmall',
'travelweb3': '/usr/apache-dev/htdocs/travelist/images/logossmall',
'traveltest': '/usr/apache/htdocs/travelist/images/logossmall'},
'/usr/resin/resin-3.0.19/webapps/backoffice/tmpimages/par': {'travelmgm': '/usr/resin/resin-3.0.19/webapps/backoffice/images/par',
'travelweb': '/usr/apache/htdocs/travelist/images/logosmid',
'travelweb2': '/usr/apache/htdocs/travelist/images/logosmid',
'travelsdrs2': '/usr/apache/htdocs/travelist/images/logosmid',
'travelweb3': '/usr/apache/htdocs/travelist/images/logosmid',
'travelweb3': '/usr/apache-dev/htdocs/travelist/images/logosmid',
'traveltest': '/usr/apache/htdocs/travelist/images/logosmid'},
'/usr/resin/resin-3.0.19/webapps/backoffice/tmpimages/par/big': {'travelmgm': '/usr/resin/resin-3.0.19/webapps/backoffice/images/par/big',
'travelweb': '/usr/apache/htdocs/travelist/images/logosbig',
'travelweb2': '/usr/apache/htdocs/travelist/images/logosbig',
'travelsdrs2': '/usr/apache/htdocs/travelist/images/logosbig',
'travelweb3': '/usr/apache/htdocs/travelist/images/logosbig',
'travelweb3': '/usr/apache-dev/htdocs/travelist/images/logosbig',
'traveltest': '/usr/apache/htdocs/travelist/images/logosbig'} }
for source, destdic in config.items():
for host, destination in destdic.items():
status = os.system("scp %s/.* %s:%s" % (source, host, destination))
if status:
msg = "cant sync host %s directory %s" % (host, destination)
os.system("echo '%s' | mail -s 'sync problem' andrey@syslogics.co.il" % msg)
break
else:
os.system("rm -f %s/*" % host)