aboutsummaryrefslogtreecommitdiff
path: root/scripts/rsync-mirror
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/rsync-mirror')
-rw-r--r--scripts/rsync-mirror16
1 files changed, 13 insertions, 3 deletions
diff --git a/scripts/rsync-mirror b/scripts/rsync-mirror
index ae54e40..17b6be2 100644
--- a/scripts/rsync-mirror
+++ b/scripts/rsync-mirror
@@ -95,11 +95,21 @@ def set_own_perm():
for root, dirs, files in os.walk(LOCAL_REPO_PATH):
for ldir in dirs:
dir_path = os.path.join(root, ldir)
- os.chown(dir_path, usr, grp)
- os.chmod(dir_path, dir_perm)
+ if os.path.islink(dir_path):
+ continue
+ try:
+ os.chown(dir_path, usr, grp)
+ os.chmod(dir_path, dir_perm)
+ except OSError, ex:
+ logger.error("Error setting ownership of %s." % dir_path)
+ logger.debug(ex)
for f in files:
file_path = os.path.join(root, f)
- os.chown(file_path, usr, grp)
+ try:
+ os.chown(file_path, usr, grp)
+ except OSError, ex:
+ logger.error("Error setting ownership of %s." % file_path)
+ logger.debug(ex)
def args_parser():