FS#71617 - Add rsync-only lastupdate support to syncrepo script
Attached to Project:
Arch Linux
Opened by Niklas Edmundsson (nikke) - Sunday, 25 July 2021, 22:16 GMT
Last edited by Anton Hvornum (Torxed) - Saturday, 04 March 2023, 17:11 GMT
Opened by Niklas Edmundsson (nikke) - Sunday, 25 July 2021, 22:16 GMT
Last edited by Anton Hvornum (Torxed) - Saturday, 04 March 2023, 17:11 GMT
|
Details
Hi!
https://gitlab.archlinux.org/archlinux/infrastructure/-/blob/master/roles/syncrepo/files/syncrepo-template.sh currently requires a http/https URL to enable lastupdate awareness. I would suggest to enhance the script to allow using rsync to check lastupdate freshness. With a reasonably modern rsync, this is IMHO easiest done with something similar to: needupd="$(rsync -n -R -t --no-motd --out-format='%n' --timeout=60 rsync://source.site/lastupdate /destination/dir/)" if [ $? = 0 -a -z "$needupd" ]; then echo "Up 2 date, only rsync lastsync" else echo "Need update, do full rsync" fi Granted, it doesn't do the full compare of the lastupdate content, but it's good enough as a freshness check in the general use case. With this addition, the script would work out of the box by only supplying it with an rsync URL making setup easier for mirror admins, and removes the requirement that the master site provides lastupdate via http/https. While the latter might not be stricly needed as the Arch Linux master provides it via http(s), it might help lastupdate/lastsync adoption by other projects which would be a Good Thing for us mirror admins. Cheers, /Nikke |
This task depends upon
Closed by Anton Hvornum (Torxed)
Saturday, 04 March 2023, 17:11 GMT
Reason for closing: Upstream
Additional comments about closing: Migrated to GitLab
Saturday, 04 March 2023, 17:11 GMT
Reason for closing: Upstream
Additional comments about closing: Migrated to GitLab
I've gone ahead and migrated this suggestion to a ticket in our GitLab: https://gitlab.archlinux.org/archlinux/infrastructure/-/issues/497
I'll therefore go ahead and close this ticket in favor of keeping the discussions in once place.
Thank you!
//Anton