Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#9669 - [Mirrors] rsync status file for mirror checking
Attached to Project:
Arch Linux
Opened by Gerhard Brauer (GerBra) - Sunday, 24 February 2008, 17:28 GMT
Last edited by eliott (cactus) - Saturday, 12 April 2008, 22:00 GMT
Opened by Gerhard Brauer (GerBra) - Sunday, 24 February 2008, 17:28 GMT
Last edited by eliott (cactus) - Saturday, 12 April 2008, 22:00 GMT
|
DetailsHi, first excuse my bad english, i hope you see what i mean ;-)
I (maybe someone still knows) do a little mirror checking since a few weeks. I do this by a script which try to check since when a mirror wasn't syned. The problem is: the only time checking i could do is calculating the difference of the mtime from each of the repo/architecture db file. But this says nothing about the last mirror sync run (ex. you Devs update core and so i only have a time diff between now and mtime of the core db on the mirror. If this diff is for ex. 5 days i could not assume that the mirror has not synced since 5 days) I thought about a solution, maybe found one which could be easily implemented with no harm: Could you run a cron script on rsync.archlinux.org which touch short after midnight some files? I guess: The files could be 0 byte files named lastsync. One should be placed in the main dir of the rsync module ::ftp and one in each repository for both architectures. So i (and maybe others) could easily check when the mirror overall last synced and also for each repo. |
This task depends upon
Closed by eliott (cactus)
Saturday, 12 April 2008, 22:00 GMT
Reason for closing: Implemented
Additional comments about closing: implemented.
Saturday, 12 April 2008, 22:00 GMT
Reason for closing: Implemented
Additional comments about closing: implemented.
date > /home/ftp/{core,extra,testing,unstable}/os/{i686,x86_64}/.lastsync
This way we should be able to check how often a mirror syncs.
Date is in UTC (date -u)
At the moment i used these values only for display until most/all mirrors have synced with.
We have no .lastsync currently in [community] cause Pierrehas no access(?). If we want this too maybe Pierre's cron job must be run by a user with higher privileges.
It's not only usefull for my script, one could easily do for ex. a:
-----
wget -q -O - ftp://ftp.archlinux.org/core/os/i686/.lastsync
Mon Feb 25 14:01:01 UTC 2008
----
to get the last sync for a mirror and repo. Also we could see: the mirror must have done his sync between time reported and a 2 hour offset, where all times must be interpreted in UTC.
Pierres cron job is run every 2 hours (Pierre, correct me if i'm wrong)
* Rename the sync file from .lastsync to lastsync. Some ftp servers doesn't allow access to hidden files.
* Add the [community] repo also to the cron job.
LANG=C date -u > /home/ftp/{core,extra,testing,unstable,community}/os/{i686,x86_64}/lastsync
Using bahs the following should work:
LANG=C date | tee /home/ftp/{core,extra,testing,unstable,community}/os/{i686,x86_64}/lastsync >/dev/null
seconds since the epoch is much easier to parse, and perform simple math upon via the shell or other language. It is also not sensitive to timezone (as clients do the differential calculations to arrive at localtime).
date +"%s" > /home/ftp/{core,extra,testing,unstable,community}/os/{i686,x86_64}/lastsync
/etc/cron.hourly/lastsync.sh
##########
#!/bin/bash
REPOS=('core' 'extra' 'community')
ARCHES=('i686' 'x86_64')
for repo in ${REPOS[@]}; do
for arch in ${ARCHES[@]}; do
date +"%s" > "/home/ftp/${repo}/os/${arch}/lastsync"
done
done
##########
edit:
oh. also.. you can easily convert back to localtime from within bash (most shells).
>>> date -d "@$(wget -q -O - ftp://ftp.archlinux.org/core/os/i686/lastsync)"
>> Sat Apr 12 18:01:05 EDT 2008