#!/usr/bin/python
import os
root = '/home/'
names = os.listdir(root)
#names = open('/mnt/data/names.txt','r')
names.sort()
for line in names:
# if not line:
# break
if not os.path.isdir(root + line):
continue
if line == 'lost+found':
continue
print "[" "%s" "]" %line
print ' comment = ''%s' %line
print ' path ='+root +line
print """ use chroot = yes
max connections=10
lock file = /var/lock/rsyncd
read only = no
list = yes
"""
print ' uid= '+line
print ' gid= '+line
print """ ignore errors = no
ignore nonreadable = yes
transfer logging = no
log format = %t: host %h (%a) %o %f (%l bytes). Total %b bytes.
timeout = 600
refuse options = checksum dry-run
dont compress = *.gz *.tgz *.zip *.z *.rpm *.deb *.iso *.bz2 *.tbz
"""
với cái này sẽ tiết kiệm được chút thời gian và công sức :).
31 Mar 2010
rsync modules
Dùng cái này
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment