.. and include _only_ those in second sync run.
---
roles/s3-mirror/files/s3.sh | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/roles/s3-mirror/files/s3.sh b/roles/s3-mirror/files/s3.sh
index 163e3dc36..4b300e370 100644
--- a/roles/s3-mirror/files/s3.sh
+++ b/roles/s3-mirror/files/s3.sh
@@ -3,9 +3,9 @@
# LGPL
# Author: Rick Elrod <relrod(a)redhat.com>
-base_cmd=(
- aws s3 sync
- --no-follow-symlinks
+aws_sync=( aws s3 sync --no-follow-symlinks )
+
+excludes=(
--exclude "*/.snapshot/*"
--exclude "*/source/*"
--exclude "*/SRPMS/*"
@@ -89,14 +89,15 @@ base_cmd=(
)
# First run this command that syncs, but does not delete.
-# It also excludes repodata.
-CMD1=( "${base_cmd[@]}" --exclude "*/repodata/*" )
+# It also excludes repomd.xml.
+CMD1=( "${aws_sync[@]}" "${excludes[@]}" --exclude
"*/repomd.xml" )
-# Next we run this command which also includes repodata.
-CMD2=( "${base_cmd[@]}" )
+# Next we run this command which syncs repomd.xml files. Include must precede
+# the large set of excludes.
+CMD2=( "${aws_sync[@]}" --exclude "*" --include
"*/repomd.xml" "${excludes[@]}" )
# Then we delete old RPMs and old metadata (but after invalidating caches).
-CMD3=( "${base_cmd[@]}" --delete )
+CMD3=( "${aws_sync[@]}" "${excludes[@]}" --delete )
S3_MIRROR=s3-mirror-us-west-1-02.fedoraproject.org
DIST_ID=E2KJMDC0QAJDMU
--
2.25.1