#!/bin/sh # See https://forge.fedoraproject.org/infra/tickets/7130 # Basically we have an OLD (old 7 years ago, as of 2025-10) set of content # and a new set of content. We want to serve the new content, and if nothing # exists there then instead serve the old content. # The simple way is to: # 1. rsync old to docs.fedoraproject.org # 2. rsync new to docs.fedoraproject.org # 3. rsync docs.fedoraproject.org to docs-combined # BUT see https://forge.fedoraproject.org/infra/tickets/12848 # -a is the std. copy everything "archive" mode. # -H means try to copy hardlinks as hardlinks # --no-times --checksum means that if the file changes mtime we still keep # the old file (and thus. the old hardlink). rsync_cmd="rsync -aH \ --no-times --checksum \ --timeout 300 \ --delete --delete-after --delete-excluded" old=sundries01::docs/ new=sundries01::docs-redirects/ docs=/srv/web/docs.fedoraproject.org/ redr=/srv/web/docs-redirects/ comb=/srv/web/docs-combined/ ex1="--exclude=.git --exclude='copying.tmp/'" $rsync_cmd --link-dest $redr --link-dest $comb $ex1 $old $docs $rsync_cmd --link-dest $docs --link-dest $comb $ex1 $new $redr # build the combined docs tree. $rsync_cmd --exclude='.git*' $docs $redr $comb