We have a mirror server we sync from repo.alma. However, when a new OS branch is sync’d example 8.7, the symlink for alma8 is symlinked to 8.7 here:
[root@our-local-repo:/root]$ ls -lh /repo/mirrors/almalinux
total 32K
lrwxrwxrwx 1 root root 3 Nov 10 09:37 8 -> 8.7/
lrwxrwxrwx 1 root root 3 Nov 16 17:05 9 -> 9.1/
We wish to sync the mirror repo, but just wish to avoid the main OS version symlinked to latest OS branch (alma8 to 8.7 or alma9 to 9.1) - because our TFT images are last OS version and build fails due to this - how can I achieve this?
We wish to manually link as we are confirmable and netboot images are loaded into our netboot servers. Help.
I would say to rsync the minor versions and set the symlink yourself - so in the below you would need to rsync 8.6 but not 8, then set the symlink from 8.6 to 8 yourself:
#!/bin/bash
alma_local_repo_dir="/repo/mirrors/almalinux-minor"
alma_versions=( 8.6 8.7 9.1)
for alma_version in ${alma_versions[@]}; do
/usr/bin/flock -n /var/run/almalinux_rsync-"${alma_version}"-.lock -c "/usr/bin/rsync -avSH -f 'R .~tmp~' --delete-delay --delay-updates rsync://rsync.repo.almalinux.org/almalinux/${alma_version} ${alma_local_repo_dir}/${alma_version}"
sleep 5;
done
Then symlink : /repo/mirrors/almalinux-major/8 → /repo/mirrors/almalinux-minor/8.7
The problem is if this gets sync’d /repo/mirrors/almalinux-major/8 and wondering it will reset my symlink to /repo/mirrors/almalinux-major/8 → /repo/mirrors/almalinux-major/8.8 etc
rsync --no-links - scares me, I noticed there some symlinks in netboot images / packages and repo might break.
Just wished if I could skip that one $major → $latest_minor symink. Thank you so much for your reply.
I had repo sync/mirror in:
/repo/mirrors/almalinux
I did the following:
mkdir /repo/mirrors/alma_custom_repo_link/
ln -s /repo/mirrors/almalinux/8.7 /repo/mirrors/alma_custom_repo_link/8.7
ln -s /repo/mirrors/alma_custom_repo_link/8.7 /repo/mirrors/alma_custom_repo_link/8
You have “rsync --delete” and you are still syncing 8.6. That means that when the 8.6 is moved to vault (should happen soon), your mirror copy will be wiped.
You need have to stop syncing the 8.6, or you will lose your copy (unless that is your intention).
(The last addition to 8.6 was made before 8.7 was released.)