~elementary-os/ubuntu-cdimage/ondemandftpsync

« back to all changes in this revision

Viewing changes to bin/anonftpsync

  • Committer: Colin Watson
  • Date: 2011-10-19 00:16:40 UTC
  • Revision ID: cjwatson@canonical.com-20111019001640-3f877r922ln0tt5j
anonftpsync: set permissions using rsync --chmod=, which is significantly faster than the old approach of a post-hoc find/xargs/chmod

Show diffs side-by-side

added added

removed removed

Lines of Context:
93
93
set +e
94
94
 
95
95
rsync --recursive --links --hard-links --times --verbose --stats \
 
96
     --chmod=Dg+s,g+rwX \
96
97
     --compress \
97
98
     --exclude "Archive-Update-in-Progress-${HOSTNAME}" \
98
99
     --exclude Packages* --exclude Sources* \
103
104
 
104
105
# Second pass to update metadata and clean up old files.
105
106
rsync --recursive --links --hard-links --times --verbose --stats \
 
107
     --chmod=Dg+s,g+rwX \
106
108
     --compress \
107
109
     --delay-updates --delete --delete-after \
108
110
     $EXCLUDE \
111
113
# Delete dangling symlinks.
112
114
find $TO/ -type l -xtype l | xargs -r rm 
113
115
 
114
 
# Make sure everything is group-writable etc. (the upstream mirror may have
115
 
# too restrictive permissions, so umask doesn't help).
116
 
find "$TO" -type d -print0 | xargs -0r chmod g+s 2>/dev/null || true
117
 
chmod -R g+rwX "$TO" 2>/dev/null || true
118
 
 
119
116
mkdir -p "${TO}/project/trace"
120
117
date -u > "${TO}/project/trace/${HOSTNAME}"
121
118