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??
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.
Hi everyone, We are looking to learn more about development teams’ workflows and pain points, especially around DevOps, integrations, administration, scale, security, and the related challeng...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events