diff options
author | Milo Casagrande <milo@ubuntu.com> | 2013-03-15 17:27:15 +0100 |
---|---|---|
committer | Milo Casagrande <milo@ubuntu.com> | 2013-03-15 17:27:15 +0100 |
commit | a6035b2eb1f916d2fcaa71f42a8699a2427f1625 (patch) | |
tree | 1fe0ea73bdb602da0faa40904f87574742cb6a2e | |
parent | 077f78f01b5222e771b8d39fc0d3dc4161580260 (diff) |
Fixed rsync command, preseve permission on files.
-rw-r--r-- | scripts/rsync-mirror | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/rsync-mirror b/scripts/rsync-mirror index 1cbad1d..ae54e40 100644 --- a/scripts/rsync-mirror +++ b/scripts/rsync-mirror @@ -86,7 +86,8 @@ def set_own_perm(): dir_perm |= stat.S_IRGRP | stat.S_IWGRP | stat.S_IXGRP dir_perm |= stat.S_IROTH | stat.S_IXOTH - # Files are 664 + # Files are 664, not used at the moment, we keep the same + # permission os the original. file_perm = stat.S_IRUSR | stat.S_IWUSR file_perm |= stat.S_IRGRP | stat.S_IWGRP file_perm |= stat.S_IROTH @@ -99,7 +100,6 @@ def set_own_perm(): for f in files: file_path = os.path.join(root, f) os.chown(file_path, usr, grp) - os.chmod(file_path, file_perm) def args_parser(): @@ -172,9 +172,9 @@ def rsync_repo(what, where, r_filter=None): :param r_filter: A filter to apply to rsync. """ cmd_args = ["rsync", "-e"] - cmd_args += ["'ssh -i %s -l %s'" % (SSH_KEY, SSH_USER)] - cmd_args += ["-r", "-l", "--copy-unsafe-links", "-z", "-t"] - cmd_args += ["--compress-level=8", "--delete"] + cmd_args += ["ssh -i %s" % SSH_KEY] + cmd_args += ["-r", "--safe-links", "--copy-unsafe-links", "-z"] + cmd_args += ["--compress-level=8", "-t", "--delete", "-p"] if r_filter: cmd_args += ["--filter=%s" % r_filter] cmd_args += ["%s@%s:%s" % (SSH_USER, GIT_SERVER, what)] |