What is the best method to check if gerrit mirrors are in sync with the master??
I have 1 master and 5 mirors and then are running the replication but sometimes we see that the mirrors don't have the latest objects.
Is there a way command line or rest to check if the mirrors are in sync??
Thank you
Anish
Hi Anish!
There are a few ways to figure out when a repository on a mirror was last updated. Here's a little shell script that can do it for you:
PROJECT=<project_key> REPO=<repository_slug> HOST=<hostname> && curl -s "https://$HOST/rest/mirroring/latest/repos/$(curl -s -H "$COOKIE" https://$HOST/rest/api/latest/projects/$PROJECT/repos/$REPO | jq .id)/mirrors" | jq -r .values[].links.self[].href | while read url; do curl -s "$url"| jq -r '.mirrorName + "\t" + (.updatedDate | (. / 1000 | strftime("%Y-%m-%d %H:%M:%S")))'; done
This should print something like
Mirror Name 1 2020-04-23 23:52:11
Mirror Name 2 2020-04-23 23:52:07
You can of course adjust the script to your needs, you need to have the command "jq" installed on your system for it to work, and the necessary data is available since Bitbucket 6.7.
Cheers,
Wolfgang
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.